View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Delete Columns if rows 8 & 9 are blank and place border

Test this on a copy of your sheet.

Sub cleansheet()
Dim j As Long, i As Long
j = 0
For i = 256 To 5 Step -1
If Application.CountA(Cells(8, i).Resize(2, 1)) = 0 Then
Columns(i).EntireColumn.Delete
Else
j = j + 1
End If
Next
ActiveSheet.UsedRange
With Cells(6, 1).Resize(5, 4 + j)
.BorderAround Weight:=xlThick
End With

--
Regards,
Tom Ogilvy


End Sub"manfareed" wrote:

Hi

I wish to delete columns from column "E" onwards which have no value on rows
8 and 9. Also I would like to place a "thick box border" around rows 6 to 10
up to the and including the last column with data.

Thanks