How can I ask Excel to hide columsn based on the value in row 6? Basically anytime the word "MCF" shows up in row 6, the whole column should be hidden.
Data range is from column A to AK.
Thank you!
How can I ask Excel to hide columsn based on the value in row 6? Basically anytime the word "MCF" shows up in row 6, the whole column should be hidden.
Data range is from column A to AK.
Thank you!
[vba]
Sub HideData()
Dim mpLastCol As Long
Dim i As Long
With ActiveSheet
mpLastCol = .Cells(6, .Columns.Count).End(xlToLeft).Column
For i = 1 To mpLastCol
.Columns(i).Hidden = .Cells(6, i).Value = "MCF"
Next i
End With
End Sub
[/vba]
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
brilliance
thank you
kindly mark your thread as solved the moment u got acceptable reply as it saves time in looking thread which r already been solved.
so pl from next time mark thread as solved as u get required reply.
this option is located in the thread tools.