View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
ajvasel ajvasel is offline
external usenet poster
 
Posts: 26
Default Select All Cells Containing Data

To further expand on this question, is it possible to select all of the cells
of a specific column when some of the cells in said column are blank.

I tried selecting a range greater than the cells containing data and used
control-shift-up, but in the next section of the code where I add a border,
it added a border around the entire column.

(example):
Range("K4:K4000").Select
Range(Selection, Selection.End(xlUp)).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = 3
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = 3
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = 3
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = 3
End With

Thanks