+ Reply to Thread
Results 1 to 6 of 6

Select range base on another Column

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    10-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    112

    Select range base on another Column

    I am trying to select column B, based on the range of column A.

    Since Column B has some blanks cells. Since I treid to use this function for column B and it didn't work since the cells are blank

        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlToRight)).Select
    Also once column B is selected convert the text to Numbers format
    Attached Files Attached Files

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Select range base on another Column

    maybe so
    'Range("A2", Cells(Rows.Count, 1).End(xlUp)).Offset(, 1).Select
    Range("A2", Cells(Rows.Count, 1).End(xlUp)).Offset(, 1).TextToColumns 'convert the text to Numbers format

  3. #3
    Forum Contributor
    Join Date
    10-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: Select range base on another Column

    Thanks for your help.
    When I use the TextToColumns function, the numbers are still left align.

    Aren't numbers in excel saved in the format as right align is a number and text is left align.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Select range base on another Column

    Try this

    Select the whole column B and right click, select format cells and change the format to number with 0 decimal places.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  5. #5
    Forum Contributor
    Join Date
    10-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: Select range base on another Column

    Thanks for all your help everyone.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Select range base on another Column

    Am glad it worked.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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