vbaisconfusing
New Member
- Joined
- Apr 15, 2013
- Messages
- 5
Hello all,
I was wondering if anyone could come up with some code to help me out.
I have a number of strings in adjacent columns in the same row, like so.
Coulmn1 Column2 "blank" Column3
If the cell is blank I want to hide the respective column .
I'm guessing the code will roughly take the form of the code below with an if statement nested in a for statement.
Sub (test)
With Range("BD22")
For i = 1 To 10
if range (i,22) = "" then hide
else don't hide
.Offset(1, 0).Formula
Next i
End With
I was wondering if anyone could come up with some code to help me out.
I have a number of strings in adjacent columns in the same row, like so.
Coulmn1 Column2 "blank" Column3
If the cell is blank I want to hide the respective column .
I'm guessing the code will roughly take the form of the code below with an if statement nested in a for statement.
Sub (test)
With Range("BD22")
For i = 1 To 10
if range (i,22) = "" then hide
else don't hide
.Offset(1, 0).Formula
Next i
End With