I have recorded a macro to hide and unide a column but the problem is that it has to be hidden manualy by running the macro. whereas I want to hide the column when the cursor moves from column B
I have made a form where column B is for information purpose only and is kept hidden and unhidden by the user if they need the same and put entries there however this has be kept hidden finally, which many users forget to do it. So i need a macro which will unhide column B when the user change cursor from column B and if the user closes the excel from column B then before close column B should be hidden.
THe code I am using as below:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Columns("B:B").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select
End Sub