Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I thought I posted this but it appears not to be showing so sorry if
there are two next to each other. I am trying to do a user input that if what I put in is in a cell that cells font will be blue. When I do it nothing happens. I did the place my mouse of the cell and input to see what it was seeing and it says they both see 100 but the macro doesn't change the font still. Do While Userinput < "done" Userinput = InputBox("Type in goal.Type 'done' to stop.") If Userinput = Range("G2") Then Range("G2").Font.Color = RGB(0, 0, 255) Loop End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jul 25, 8:20 am, wrote:
I thought I posted this but it appears not to be showing so sorry if there are two next to each other. I am trying to do a user input that if what I put in is in a cell that cells font will be blue. When I do it nothing happens. I did the place my mouse of the cell and input to see what it was seeing and it says they both see 100 but the macro doesn't change the font still. Do While Userinput < "done" Userinput = InputBox("Type in goal.Type 'done' to stop.") If Userinput = Range("G2") Then Range("G2").Font.Color = RGB(0, 0, 255) Loop End Sub I just debuged the IF statement and for some reason the Font.Color=0 even though I am trying to define it to be blue. So why does that happen. I also just tried to change it to .font.bold=true and when I debug that the macros says its false even though thats what i'm trying to define to be true |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Works fine for me. When you debugged it, did it step into the Then
statement? -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) wrote in message ups.com... On Jul 25, 8:20 am, wrote: I thought I posted this but it appears not to be showing so sorry if there are two next to each other. I am trying to do a user input that if what I put in is in a cell that cells font will be blue. When I do it nothing happens. I did the place my mouse of the cell and input to see what it was seeing and it says they both see 100 but the macro doesn't change the font still. Do While Userinput < "done" Userinput = InputBox("Type in goal.Type 'done' to stop.") If Userinput = Range("G2") Then Range("G2").Font.Color = RGB(0, 0, 255) Loop End Sub I just debuged the IF statement and for some reason the Font.Color=0 even though I am trying to define it to be blue. So why does that happen. I also just tried to change it to .font.bold=true and when I debug that the macros says its false even though thats what i'm trying to define to be true |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jul 25, 8:20 am, wrote:
I thought I posted this but it appears not to be showing so sorry if there are two next to each other. I am trying to do a user input that if what I put in is in a cell that cells font will be blue. When I do it nothing happens. I did the place my mouse of the cell and input to see what it was seeing and it says they both see 100 but the macro doesn't change the font still. Do While Userinput < "done" Userinput = InputBox("Type in goal.Type 'done' to stop.") If Userinput = Range("G2") Then Range("G2").Font.Color = RGB(0, 0, 255) Loop End Sub When I debug it. It only highlights in yellow right before the Then. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I just tried to open a fresh new workbook and the same thing is
happening in the new workbook |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How is the user supposed to enter something that is equal to a Range?
Shouldn't the if statement be something like: If Userinput = "G2" Then Range("G2").Font.Color = RGB(0, 0,255) Peter Richardson " wrote: I thought I posted this but it appears not to be showing so sorry if there are two next to each other. I am trying to do a user input that if what I put in is in a cell that cells font will be blue. When I do it nothing happens. I did the place my mouse of the cell and input to see what it was seeing and it says they both see 100 but the macro doesn't change the font still. Do While Userinput < "done" Userinput = InputBox("Type in goal.Type 'done' to stop.") If Userinput = Range("G2") Then Range("G2").Font.Color = RGB(0, 0, 255) Loop End Sub |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I tried your "G2" but that still doesn't work. If you do the G2 thing
it will actually look for that as a string/text. I say range because its that cell. I have also tried doing Cells(2,7) and still that doesn't work. Ive also tried Cells(2,7).Value to take just the value but still nothing. I have a feeling that it's look at the sell as a string not a numeric value so it's saying its not there because if I write if userinput=95 then it works when I type in 95 in the input box. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|