ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   have input box. Need criteria entered to refer to cond. format criteria (https://www.excelbanter.com/excel-programming/293078-re-have-input-box-need-criteria-entered-refer-cond-format-criteria.html)

Bob Phillips[_6_]

have input box. Need criteria entered to refer to cond. format criteria
 
Hi Jason,

Text = InputBox("Enter the month to highlite:")

With Range("N4:S188")
Range("S188").Activate
.FormatConditions.Delete
.FormatConditions.Add Type:=xlCellValue, _
Operator:=xlEqual, _
Formula1:="=N4=MONTH(" & Text &
")"
.FormatConditions(1).Interior.ColorIndex = 40
End With

I would caution against using Text as a variable. It might not be a reserved
word yet, but it is used, and is unnecessarily dangerous.
--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jason" wrote in message
...
This is what I have. I just wish my knowledge was a little more in depth.

I need the text when entered into the input box to be inserted into the
format conditions. If I enter mar then it will put mar in for the condition
to highlite. How do I tie these together. Any help is greatly appreciated.


Text = InputBox("Enter the month to highlite:")
Application.i 'm stuck????????
Range("N4:S188").Select
Range("S188").Activate
Selection.FormatConditions.Delete
Selection.FormatConditions.add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:=i 'm stuck?????????
Selection.FormatConditions(1).Interior.ColorIndex = 40
Range("N4").Select





All times are GMT +1. The time now is 12:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com