J
Jan Kronsell
I use this code to delete alle rows, that contains an "x" in the first
column:
nr = Sheets(1).Range("a65536").End(xlUp).Row
For i = nr To 2 Step -1
If UCase(Range("a" & i)) = "X" Then
Range("a" & i).EntireRow.Delete shift:=xlUp
End If
Next i
But how do I change it to delete all columns, that contains an "x" in the
first row? Thats is, what should I put in the Ucase and Range to make it
work?
nc = Sheets(1).Range("a65536").End(xlToLeft).Column
For h = nc To 2 Step -1
If UCase(???????) = "X" Then
Range(????).EntireColumn.Delete shift:=xlRight
End If
Next h
Jan
column:
nr = Sheets(1).Range("a65536").End(xlUp).Row
For i = nr To 2 Step -1
If UCase(Range("a" & i)) = "X" Then
Range("a" & i).EntireRow.Delete shift:=xlUp
End If
Next i
But how do I change it to delete all columns, that contains an "x" in the
first row? Thats is, what should I put in the Ucase and Range to make it
work?
nc = Sheets(1).Range("a65536").End(xlToLeft).Column
For h = nc To 2 Step -1
If UCase(???????) = "X" Then
Range(????).EntireColumn.Delete shift:=xlRight
End If
Next h
Jan