Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Nothing Happens

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Nothing Happens

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Nothing Happens

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Nothing Happens

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Nothing Happens

I just tried to open a fresh new workbook and the same thing is
happening in the new workbook




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Nothing Happens

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Nothing Happens

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"