View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Excel MVP Don Guillett Excel MVP is offline
external usenet poster
 
Posts: 168
Default Borders around cells with data in them

Sub BorderRange()
With ActiveSheet
la = .Cells.Find("*", Cells(Rows.Count, Columns.Count) _
, , , xlByRows, xlPrevious).Address
..Range("a1:" & la).Borders.LineStyle = xlContinuous
End With
End Sub

On Jan 22, 7:25*am, Johnnyboy5 wrote:
I would like a macro to automatically put a border around any cells in
a sheet that has data in it (numbers or text)

and cells with no data have no borders.

thanks

Johnnboy