brainstain
New Member
- Joined
- Feb 15, 2015
- Messages
- 6
Somewhat newbie here, Hello,
I made a ledger sheet that includes a daily running balance like a checkbook, and wanted to have the
ability to highlight cells if the value falls below a minimum, BUT if I want to change that conditional minimum value on the fly, I want to be able to enter a number in a separate cell, click a button (which I know how to make a button to run a macro) and have that number passed to a variable that goes into the macro of the Conditional Formatting macro I recorded and allow the minimum balance to change based on user input.
This is a 'part' of the Cond. Format. I recorded with the value of 'less than 50' that I want to be able to change by entering another number in a cell, click a button, and it passes then new value to that variable.
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=50"
So Im guessing the variable would be within the quotes area?
And need to pass the variable some how, (value will only be whole numbers).
I know how to have the macro read the cell of user input, but dont know how to properly assign that value to a proper variable (long, integer...) then pass it to the macro and change it from the original input of 'less than 50'.
Suggestions please?
Thanks
David
I made a ledger sheet that includes a daily running balance like a checkbook, and wanted to have the
ability to highlight cells if the value falls below a minimum, BUT if I want to change that conditional minimum value on the fly, I want to be able to enter a number in a separate cell, click a button (which I know how to make a button to run a macro) and have that number passed to a variable that goes into the macro of the Conditional Formatting macro I recorded and allow the minimum balance to change based on user input.
This is a 'part' of the Cond. Format. I recorded with the value of 'less than 50' that I want to be able to change by entering another number in a cell, click a button, and it passes then new value to that variable.
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=50"
So Im guessing the variable would be within the quotes area?
And need to pass the variable some how, (value will only be whole numbers).
I know how to have the macro read the cell of user input, but dont know how to properly assign that value to a proper variable (long, integer...) then pass it to the macro and change it from the original input of 'less than 50'.
Suggestions please?
Thanks
David