+ Reply to Thread
Results 1 to 10 of 10

How to extract values within different ranges to different columns

  1. #1
    Registered User
    Join Date
    06-10-2019
    Location
    Sydney
    MS-Off Ver
    2016
    Posts
    5

    How to extract values within different ranges to different columns

    Hi fellow Excel Masters,

    Can you please help me to code this problem to run the macro? (First assignment first question in the attached file).
    I need to extract the given values from 1 - 50 (include decimal values) to different columns e.g. 0-5, 5-10, 10-15, 15-20, 20- 25, etc.

    This is my effort so far which only address one range as if I use "If" statement for other ranges, it does not work

    Dim x As Integer
    x = 2
    For Each Cell In Range("A1:A1046")
    If Cell.Value > 0 And Cell.Value <= 5 Then
    Cells(x, 4) = Cell.Value
    x = x + 1
    Next Cell
    End Sub

    Much appreciated, guys
    Attached Files Attached Files
    Last edited by huongnq810; 06-10-2019 at 07:40 AM.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow

    Hi !

    No need a code, just easy formulas at child level ! Even via VBA, no need any loop just using formulas …

    If you can't really achieve this, try at least to attach a workbook according to your need.
    Last edited by Marc L; 06-10-2019 at 06:28 AM.

  3. #3
    Registered User
    Join Date
    06-10-2019
    Location
    Sydney
    MS-Off Ver
    2016
    Posts
    5

    Re: How to extract values within different ranges to different columns

    Hi Marc,

    I have no idea... and it must be solved with VBA. I'm just new to VBA and I learned those codes from other threads. I have attached a workbook for your information. There are other problems in that workbook as well which im also struggling. I would really appreciate it if you can help me with those. Thanks
    Last edited by huongnq810; 06-10-2019 at 07:41 AM.

  4. #4
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: How to extract values within different ranges to different columns

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-10-2019
    Location
    Sydney
    MS-Off Ver
    2016
    Posts
    5

    Re: How to extract values within different ranges to different columns

    hi Dangelo thanks so much for your help. I really appreciate it

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,464

    Re: How to extract values within different ranges to different columns

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-10-2019
    Location
    Sydney
    MS-Off Ver
    2016
    Posts
    5

    Re: How to extract values within different ranges to different columns

    Hi Jindon Thank you. Really appreciate it
    Last edited by huongnq810; 06-10-2019 at 10:53 AM.

  8. #8
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: How to extract values within different ranges to different columns

    Please Login or Register  to view this content.

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,464

    Re: How to extract values within different ranges to different columns

    You are welcome and thanks for the rep.

    I think I missed to color the cells for 2nd.
    Please Login or Register  to view this content.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  10. #10
    Registered User
    Join Date
    06-10-2019
    Location
    Sydney
    MS-Off Ver
    2016
    Posts
    5

    Re: How to extract values within different ranges to different columns

    👍
    Thanks for the advice

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Extract values and the use index to transpose values across columns to rows
    By bjnockle in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-19-2017, 08:46 PM
  2. [SOLVED] How To: Extract unique values from 3 columns into 1 column.
    By egarcia7 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-24-2016, 12:31 PM
  3. Extract Values from a Table Cell Using Ranges
    By lostincyberspace in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-22-2014, 02:45 PM
  4. [SOLVED] Finding values within (2) ranges in (2) columns
    By K_Cooper in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-08-2012, 11:04 AM
  5. Finding values within (2) ranges in (2) columns
    By K_Cooper in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-07-2012, 08:33 PM
  6. [SOLVED] Extract unique values from 2 columns DYNAMICALLY
    By albatr0n in forum Excel General
    Replies: 17
    Last Post: 08-28-2012, 08:42 AM
  7. Replies: 5
    Last Post: 11-15-2010, 10:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1