Hide Column based on Cell Value

  • Thread starter Thread starter tomic
  • Start date Start date
T

tomic

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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top