By using t2do.com you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

T2Do.com

 


Code to Hide/Show data when moving activecell

'This code is useful for when Excel pops up something private and you don't want others to see it
'The data to hide needs to be grouped
Private Sub Worksheet_SelectionChange(ByVal Target as Range)
On Error Resume Next
If Target.Column = 12 then
   Columns("A:A").ShowDetail = True
   Range("B" & Target.Row).Select
Elseif Target.Column = 1 Then
   Columns("A:A").ShowDetail = False
End if
'Don't do Target.Select or will cause infinite loop
End Sub