Excel Excel vba column hiding unhiding

Joined
Oct 23, 2012
Messages
29
Reaction score
0
hey
i have a problem and it goes this way
i wrote excel (2010) vba code to hide acolumn when the workbook open

Private Sub Workbook_Open()
Sheets("InputData").columns(12).EntireColumn.hidden=true
End Sub

and it works perfect
but i need to add an event so if the user unhide that column manualy the sheet would hide it again

any ideas???
 
Last edited:
sorry for replaying late, i was busy with another urgent project
thank u for your replay
but i think that

Private Sub Worksheet_Change(ByVal Target As Range)
'your code
End Sub


doesn't consider manual hiding unhidinng for column as an event to enter it

i tried it with

if target.column=12 then.......etc
if Sheets("InputData").columns(12).EntireColumn.hidden=False then.......etc

and it didn't work
any other ideas??

thank u in advance
 
Back
Top