![]() |
#8
|
|||
|
|||
![]()
Hi,
to know the last row of the "state column" (AB) which is taken into account, there are a number of ways to get this info. Either extend the existing macro by: Cells(1, 1) = LastRow1 Put this just before "End Sub", then cell A1 of the sheet "Original" will show you the value. You can also implement the additional macro below. In this version it gives a popup-message, showing the last column of the column you have activated. By removing the remark symbol of the command "ActiveCell.Value = LastRow1", you can also have the value written in the current cell (whatever fits you best). Kind regards Bjorn Sub LastRow() Dim LastRow1 As Long Dim i As integer With ActiveSheet LastRow1 = .Cells(.Rows.Count, ActiveCell.Column).End(xlUp).Row End With i = MsgBox("Last Row for this column is " & LastRow1, vbOKOnly + vbInformation) ' ActiveCell.Value = LastRow1 End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Creating a MACRO | Nikb3522 | Word VBA | 0 | 10-21-2010 05:55 PM |
![]() |
diegogeid | Excel | 2 | 09-30-2010 12:19 AM |
creating macro | steveb | Word VBA | 0 | 08-14-2010 01:29 AM |
![]() |
nolesca | Excel | 4 | 06-07-2010 08:13 AM |