Hi everyone, been working on a excel project for a bit now and cant figure out part of it. In the project we had to create an annuity table with with spin buttons to change interest rate, number of terms ect. Anyway, I'm stuck on a part where we're supposed to highlight contingent cells. For example if there are only 5 payment terms then the chart only shows 5 rows of values. However, the maximum number of terms on the spin button is 30 and when i click my command button to highlight a certain type of data (ex. Principal amount) it still highlights 30 cells rather than just the 5 cells with values in them.
Im guessing i have to edit the macro assigned to the command button in microsoft visual basic but am not sure. Anyway this is what the macro looks like in visual basic.
Sub Highlight_Principal()
'
' Highlight_Principal Macro
'
'
Range("E9:E42").Select
With Selection.Interior
.Pattern = xlSolid
PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End Sub
Guessing it has something to do with the Range("E9:42").Select line but Im not sure how to edit it to highlight only the cells with values in them. Minimum number of values is 5 max is 30.
Any assistance would be greatly appreciated.
Thanks
Im guessing i have to edit the macro assigned to the command button in microsoft visual basic but am not sure. Anyway this is what the macro looks like in visual basic.
Sub Highlight_Principal()
'
' Highlight_Principal Macro
'
'
Range("E9:E42").Select
With Selection.Interior
.Pattern = xlSolid
PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End Sub
Guessing it has something to do with the Range("E9:42").Select line but Im not sure how to edit it to highlight only the cells with values in them. Minimum number of values is 5 max is 30.
Any assistance would be greatly appreciated.
Thanks