Thread: Range empty?
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Range empty?

Hi Sige,

Change:

MsgBox rLastRowCell


to:
MsgBox rLastRowCell.Address



---
Regards,
Norman



"Sige" wrote in message
oups.com...
Hi There,

How comes Range = Nothing?
I would like the message box to show something like: F125

Thanks, Sige


Sub Show_Usedrange()
Dim lngLastRow As Long
Dim rLastRowCell As Range
On Error Resume Next
lngLastRow = 1

With ActiveSheet.UsedRange

lngLastRow = .Find("*", .Cells(1), xlFormulas, xlWhole,
xlByRows, xlPrevious).Row

Set rLastRowCell = Cells(lngLastRow + 1, 6)
MsgBox rLastRowCell

End With

End Sub