View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen[_2_] Per Jessen[_2_] is offline
external usenet poster
 
Posts: 703
Default Hide Column based on Cell Value

On 20 Jun., 21:11, tomic wrote:
I am trying to hide an entire column - column M, based on the value in Cell
I13.

I would like column M to be hidden if the value in I13 is "".

I am a novice with VB, and have tried numerous things without any luck. Any
suggestions or help would be appreciated.


Hi

This is an event code, which needs to be in the codesheet for the
desired sheet.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$I$13" Then
If Target.Value = "" Then
Columns("M").Hidden = True
Else
Columns("M").Hidden = False
End If
End If
End Sub

Regards,
Per