PDA

View Full Version : Last cell in range



amrane
01-22-2012, 05:07 AM
Dear Forum

I want to pass a given range first/last row without inbox message, for this I am refereing to the belw MSD page but its not wotking, PLZ let me know the correct form

I am attaching the excelsheet for your reference,
7257


http://msdn.microsoft.com/en-us/library/cc837974%28v=office.12%29.aspx

Then add this code.
VB (http://www.vbaexpress.com/forum/)



With mybook.Worksheets(1)
FirstCell = "A2"
Set sourceRange = .Range(FirstCell & ":" & RDB_Last(3, .Cells))
' Test if the row of the last cell is equal to or greater than the row of the first cell.
If RDB_Last(1, .Cells) < .Range(FirstCell).Row Then
Set sourceRange = Nothing
End If
End With