+ Reply to Thread
Results 1 to 4 of 4

Row / column selection syntax

Hybrid View

  1. #1
    Registered User
    Join Date
    08-09-2007
    Posts
    22

    Row / column selection syntax

    I am trying to select a series of rows from row 3 to row "row", where "row" is a variable.

    i.e. some variant of
    Rows.select("3:row")
    ....
    perhaps.

    Any help is greatly appreciated. Thanks a lot.
    Last edited by VBA Noob; 01-21-2008 at 03:50 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,945
    Let r be some calculated row number, then
    Rows("3:" & r).Select
    Ben Van Johnson

  3. #3
    Forum Contributor WinteE's Avatar
    Join Date
    04-07-2007
    Location
    Netherlands
    Posts
    544
    Try this :

    Sub test()
        Range("3:" & Range("A1").Value).EntireRow.Select
    End Sub
    Where Range A1 contains the last rownumber of the ranges you want to select.

    Erik
    Just keep it simple !


    http://www.excelguide.eu
    In English as well as in Dutch

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    In most cases it is unnecessary to actually select ranges in VBA.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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