View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default Get Last Unused Cell

will this do it?

Sub borderusedrng()
ActiveSheet.UsedRange.BorderAround Weight:=xlThick
End Sub

--
Don Guillett
SalesAid Software

"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/