Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Filling a cell based on the content of another cell

That code is backwards from what you described:

If the value in
E2 says infant then I would need R2 filled with Daycare otherwise the cell
would need to be filled with preschool.


Also, notice how you have Daycare as one word.

--
Regards,
Tom Ogilvy


"Bill" wrote in message
...
Both sets of code produce the same results. I gave you the variables in

the
wrong spot. I think the problem is that Day Care is two words in our

system.
If I make it one word it works great but our system has it listed as two
words.

For mm = 2 To ActiveSheet.Cells(Rows.Count, "E").End(xlUp).Row
If Cells(mm, 5).Text = "DAY CARE" Then
Cells(mm, 18) = "INFANT"
Else
Cells(mm, 18) = "CHILD"
End If
Next


"Lonnie M." wrote:

Hi, thanks for your feedback, I just tested it again and it worked just
fine for me.
If I placed "infant" in "E2", "R2" correctly placed "Daycare"
If I placed "child" in "E3", "R3" correctly placed "Preschool"
If I placed "6" in "E4", "R4" correctly placed "Preschool"

I'm not sure what went wrong for you. You may want to make sure that
the value in the else statement wasn't changed to "infant"
HTH--Lonnie M.




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


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional formatting one cell based on content of another cell Chris Adolph Excel Discussion (Misc queries) 3 June 6th 07 06:52 PM
Conditional cell background formatting, based on cell content nosivad Excel Discussion (Misc queries) 5 February 11th 06 11:12 PM
Automatically filling in cells based on another cell's content Ginger Excel Worksheet Functions 5 September 2nd 05 09:17 AM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 1 February 11th 05 06:36 AM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 0 February 11th 05 05:35 AM


All times are GMT +1. The time now is 05:49 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"