+ 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
    3,532

    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
    Valued Forum Contributor dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    953

    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
    Posts
    14,668

    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
    Valued Forum Contributor dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    953

    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
    Posts
    14,668

    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)

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