VBA code

D

DAGB

I need some Excel VBA code to be able to do the following:-

The user will select a month from a drop down list or combi-box.

If January is selected Columns C to M will be Hidden (plus other things)
If February is selected Columns D to M will be Hidden

Etc

Any help will be very gratefully received.

Many thanks in advance
 
J

Joel

Private Sub ComboBox1_Change()

If UCase(ComboBox1.Value) = "FEBRUARY" Then
Columns("C:M").EntireColumn.Hidden = True
Else
Columns("D:M").EntireColumn.Hidden = True
Columns("C").EntireColumn.Hidden = False
End If

End Sub
 

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

Top