NO, you haven't built up the formula string correctly. You could do it like thisi didn't realize you posted.. but this is what i came up with and its not working properly.
.FormatConditions.Add Type:=xlExpression, _
Formula1:="=LEFT(C1," & var1 & ")=""" & var2 & """"
NO, you haven't built up the formula string correctly. You could do it like thisNote though that if you do not put a check in about var1 being greater than 0, your whole column will be coloured if the user does any of these things with the Input Box :Code:.FormatConditions.Add Type:=xlExpression, _ Formula1:="=LEFT(C1," & var1 & ")=""" & var2 & """"
- Closes it with the X at the top right, or
- Clicks OK without entering anything in the text box, or
- Clicks Cancel
Also note that when posting code, please have your code indented and keep that indentation by using code tags as I have done here, or use the VBHTML Maker as I did with my earlier code. It is much harder to read and debug unindented code and many potential helpers will jsut by-pass your thread if your code is not indented. Further info in my signature block.
I'm not sure what you want to with the two inputs but for collecting them, a few choices come to mind:on my input window is there a way to input 2 different values in the same box or do i have to declare another MSG box?
An Input Box as we used in the earler code in this thread is a simple structure that allows a single input. If you want anything more complecated than that, you will need to use a UserForm. UserForms are not a real strength of mine, but here is one place that has some resources you might find helpful.How about the User Input Box, where they can enter data and use a check box in that same box ...