If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > if statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-17-04, 11:43
kylewilk kylewilk is offline
Registered User
 
Join Date: Mar 2004
Posts: 4
if statement

In microsoft excel, I know how to do a standard if statement with characters and numbers, but I'm having a problem. Is it possible to use an if statement to change background color. Specifically, I have a huge spreadsheet with certain cells that are black. I need to change these cells to have an 'X' in them, so I was hoping there was some kind of if statement like this:

if (background ="black", "x", "")

I just don't know if there's a certain way to write that.
Reply With Quote
  #2 (permalink)  
Old 03-17-04, 12:50
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Only Conditional Formatting or VBA will allow you to change cell colors.
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #3 (permalink)  
Old 03-17-04, 15:18
actuary actuary is offline
Registered User
 
Join Date: Mar 2004
Location: Fort Worth, Texas, USA
Posts: 68
Conditional formatting cannot change the cell's contents, however. So you're left with VBA. Is this a one-time change, or do you need to automatically create an 'X' when the cell's background is changed?
Reply With Quote
  #4 (permalink)  
Old 03-17-04, 16:14
kylewilk kylewilk is offline
Registered User
 
Join Date: Mar 2004
Posts: 4
Basically it's a large spreadsheet. Some cells are normal (no color fill) and some are filled black. I'm looking for a shortcut formula that will put an 'X' in cells that are black, because going through one by one will take a while. If i have to do that I will, but a formula that can conditionally check the cells would make my life easier.
Reply With Quote
  #5 (permalink)  
Old 03-17-04, 16:38
actuary actuary is offline
Registered User
 
Join Date: Mar 2004
Location: Fort Worth, Texas, USA
Posts: 68
Try the attached.
Attached Files
File Type: zip book1.zip (7.2 KB, 29 views)
Reply With Quote
  #6 (permalink)  
Old 03-17-04, 17:31
kylewilk kylewilk is offline
Registered User
 
Join Date: Mar 2004
Posts: 4
It was close enough. I know enough VB to edit the macro to how I need it. I just wasn't 100% sure on the syntax. It works great now. Thank you very much for your help.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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