+ Reply to Thread
Results 1 to 3 of 3

Capturing Row Number

Hybrid View

  1. #1
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562

    Capturing Row Number

    I know I have seen the answer to this question on this list before, but I am unable to find it now.

    I have a sub that searches a spreadsheet for information. When it finds the information it uses some offset statements to grab various data. What is the code that can be used to capture what row you are on.

    Thanks!

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Just use .Row after the range. For example:
    ActiveCell.Row
    
    ' OR
    
    Range("A65536").End(xlUp).Row
    etc.

  3. #3
    Registered User
    Join Date
    02-20-2007
    Location
    Smithtown, NY
    Posts
    3

    Wink Search Find Data and capture position

    I use -

    MyRow = ActiveCell.Row: MyCol = ActiveCell.Column

    to capture my location and then use -

    Cells(MyRow, MyCol).Select

    to re-position the cursor.

    You can position the cursor to anywhere you want by -

    ActiveCell.Offset(0, 4).Value

    Which means - move 4 cells to right on same row.

    ActiveCellOffset(2,-3).Value

    Move cursor from present position to 3 Cells left, and down 2 Cells.

+ 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