![]() |
#20
|
|||
|
|||
![]()
Hi,
Here is 2 more methods to get the "Last" row. (Not sure if Bob mentioned this) The first one uses a excel function for "Special Cells The second will look from the bottom of the column to the first row with data. Hope these help you.. Code:
Sub xlCellTypeLastCell_Example_Row() Dim LastRow As Long With ActiveSheet LastRow = .Range("A1").SpecialCells(xlCellTypeLastCell).Row End With MsgBox LastRow End Sub Code:
Sub Last_Row() ''' This is different from other example ''' We'll use the XlUp format''' ''' This looks from the bottom up '' Dim LastRow As Long With ActiveSheet LastRow = .Range("A65536").End(xlUp).Row End With MsgBox LastRow End Sub You can use this if you need to add data to the column. Code:
LastUnusedRow = .Range("A65536").End(xlUp).Row+1 |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Formatting contents after Tab of continuous lines or formatting specific area of word | pawii | Word | 1 | 05-12-2014 05:24 AM |
macros | stebrownsword | Word VBA | 0 | 08-28-2013 01:16 AM |
![]() |
anju16saini | Word VBA | 1 | 03-11-2013 04:15 AM |
![]() |
WaltR | Word VBA | 8 | 05-15-2012 06:28 PM |
Macros | nore | Outlook | 0 | 06-01-2011 04:39 PM |