Hi
One way :
Look on Debra's site for a dynamic range
http://www.contextures.com/xlNames01.html#Dynamic
--
Regards Ron de Bruin
http://www.rondebruin.nl
"Session101 " wrote in message ...
I am trying to get the last unused cell so that I can put a border
around them. This is because my result set in the worksheet is dynamic
and can contain more or less values. Right now I have macro hard-coding
the last cell in the range:
Range("A1:H16").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
LineStyle = xlContinuous
Weight = xlThin
ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
LineStyle = xlContinuous
Weight = xlThin
ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
LineStyle = xlContinuous
Weight = xlThin
ColorIndex = xlAutomatic
End With
How do I find he last unused cell in my range cell property? Thanks!
---
Message posted from http://www.ExcelForum.com/