+ Reply to Thread
Results 1 to 3 of 3

Select and Name a Range of Cells with Variable Row

  1. #1
    Registered User
    Join Date
    04-01-2011
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    1

    Question Select and Name a Range of Cells with Variable Row

    I have been trying to select a range of cells from B2 to D_". The _ represents the last row. The code does recognize the last cell in the data range adn I can select the last cell in the range individually, but I can't select the range from B2 to that Cell. I am using about 15 lines of data, but the data will be a lot larger in real uses. I will be doing a Vlookup to flill this range and will have to format the cells to remove the formulas. The Range function may be helpful, but I am unsure how to apply it in this case. this is a portion of an overall Macro.

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

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Select and Name a Range of Cells with Variable Row

    hi, flovettsr, as an option it can be done this way:

    Please Login or Register  to view this content.
    this will select range starting from B2 and to the last cell with value in column D

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Select and Name a Range of Cells with Variable Row

    or:
    Please Login or Register  to view this content.
    lastrow dimensioned as LONG
    Ben Van Johnson

+ 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