input box reference

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I can't get on the Formula1: line to refer to the month entered into the input box. My input into the box would be jan, feb, mar, apr, may, jun, jul, aug, etc. becuase that is how I have them on the spreadsheet. So for conditional formatting I need it to refer to exactly the way I type it into the input box. If mnth = Input box how do I type it below for the formula1: line to refer to what I type in.

Private Sub CommandButton7_Click(
mnth = InputBox("Enter the month to highlite:"
With Range("N4:SortRef") 'Sort Ref is just a cell nam
Range("SortRef").Activat
Selection.FormatConditions.Delet
Selection.FormatConditions.add Type:=xlCellValue, Operator:=xlEqual, Formula1:= 'Refer to input box???????
Selection.FormatConditions(1).Interior.ColorIndex = 4
End Wit
End Sub
 
I'm not sure I understand ... why not just:

Formula1:=mnth

?

--

Vasant

Jason said:
I can't get on the Formula1: line to refer to the month entered into the
input box. My input into the box would be jan, feb, mar, apr, may, jun, jul,
aug, etc. becuase that is how I have them on the spreadsheet. So for
conditional formatting I need it to refer to exactly the way I type it into
the input box. If mnth = Input box how do I type it below for the formula1:
line to refer to what I type in.
Private Sub CommandButton7_Click()
mnth = InputBox("Enter the month to highlite:")
With Range("N4:SortRef") 'Sort Ref is just a cell name
Range("SortRef").Activate
Selection.FormatConditions.Delete
Selection.FormatConditions.add Type:=xlCellValue,
Operator:=xlEqual, Formula1:= 'Refer to input box???????
 
I had to run yesterday, but the reason is becuase I kept getting a run time error. I have it fixed now, but I didn't understand why I kept getting an error when putting =mnth, but all is well now. I haven't done anything different today, but it is working. Wierd. thanks for replying if you are there.
 

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