Hello -
I'm totally newbie on Excel VB. i just happened that i have the tool that we use and just editing the code on it.
Now, I would like to ask on how can i change the font of my txtBox, if the value of my textBox is 90% or above it will turn it to green, while if 89% below the font would be red.
This would be its look like on a form
Productivity
95%
Utilization
100%
Whenever i click the word productivity it will show the value of a cell on my sheet (Sempra.txtProd = Format(Sheets("Data").Range("g3"), "0.00%")) , something like it would refresh the tool.
but this cell has also a formula on it (=IFERROR(F3/E3,"")).
i tried to use this code.
If the txtProd.value >= 90 Then
txtprod.forecolor = vbGreen
EndIf
am i doing it wrong? Please help.
Thank you!
I'm totally newbie on Excel VB. i just happened that i have the tool that we use and just editing the code on it.
Now, I would like to ask on how can i change the font of my txtBox, if the value of my textBox is 90% or above it will turn it to green, while if 89% below the font would be red.
This would be its look like on a form
Productivity
95%
Utilization
100%
Whenever i click the word productivity it will show the value of a cell on my sheet (Sempra.txtProd = Format(Sheets("Data").Range("g3"), "0.00%")) , something like it would refresh the tool.
but this cell has also a formula on it (=IFERROR(F3/E3,"")).
i tried to use this code.
If the txtProd.value >= 90 Then
txtprod.forecolor = vbGreen
EndIf
am i doing it wrong? Please help.
Thank you!