sdohertyccb
Board Regular
- Joined
- Feb 15, 2005
- Messages
- 91
Can anyone give me a clue as to what I need to do to search for blank columns in a range and delete them? I can do this for blank rows, but am stuck on deleting blank columns.
Here is the code I have started for the blank rows, but am lost on the columns section.
Here is the code I have started for the blank rows, but am lost on the columns section.
Code:
For a = 1 To lastrow Step 1
If IsEmpty(Range("B" & a)) Then
Range(a & ":" & a).Select
Selection.Delete Shift:=xlUp
End If
Next a
For b = 1 To lastcol Step 1
If IsEmpty(range() Then
Columns(b).Select
Selection.Delete
End If
Next b
Last edited: