code for ComboBox change event

T

tjb

Below is my code (that doesn't work) for a combo box.
When the user selects U.S. Postal Service from the combo
box named ShipVia and Home from the combo box named
ShipTo I want to gray out the cell named Address1. My
code doesn't seem to do it and I don't see what's wrong.
Thanks!


Private Sub ShipVia_Change()
'disables section 7 if USPS and Home selected
If Sheets("Request Form").ShipVia.Value = "U.S.
Postal Service" And Sheets("Request Form").ShipTo.Value
= "Home"
Then Range("Address1").Activate
With Selection.Interior
.ColorIndex = 16
.Pattern = xlSolid
End With
Exit Sub
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