Excel Macro help requested - How to change cell background color based on value in cell? ....
#1
AudiWorld Expert
Thread Starter
Excel Macro help requested - How to change cell background color based on value in cell? ....
As I log data in my Audi, I end up with .csv files. I'd like a way that I could open up these files, apply some saved macro (or whatever) and have the following things happen automatcially:
1.) Set the background color of any cell to Yellow in Row X if the value is > 90.
2.) Delete Row "x" if the value of the cell at Row "x", Column "y" is < some value "z". In other words, delete a given row it's value for a certain column is less than something.
3.) Save the newly created file with the same name, but with an .xls extension to support the colors that have been added.
I've peeked around the Excel help, but can't figure out how to do these things. Any help greatly appreciated.
Thanks,
1.) Set the background color of any cell to Yellow in Row X if the value is > 90.
2.) Delete Row "x" if the value of the cell at Row "x", Column "y" is < some value "z". In other words, delete a given row it's value for a certain column is less than something.
3.) Save the newly created file with the same name, but with an .xls extension to support the colors that have been added.
I've peeked around the Excel help, but can't figure out how to do these things. Any help greatly appreciated.
Thanks,
#2
Well...
You could set up a macro do do that stuff, but macros are typically stored in the .xls files themselves (.csv couldn't contain a macro since its just a text file). So you'd have to convert to a .xls file, import the macro (either from another .xls file or just saved on your HD) and then run it.
Alternatively (and I think this is more what you are looking for), you can write an Add-In for Excel so that the functionality exists from within Excel itself and can be applied to any open file (i.e., the .csv log). Thats a bit more involved than a simple macro.
-Dave Pramanik
Alternatively (and I think this is more what you are looking for), you can write an Add-In for Excel so that the functionality exists from within Excel itself and can be applied to any open file (i.e., the .csv log). Thats a bit more involved than a simple macro.
-Dave Pramanik
#3
Maybe this.....
1. Select the data you want to apply this to.
2. Format menu
3. Conditional Formatting
4. Leave first box as "Cell value is"
5. Pick condition in next box, i.e. "greater than"
6. Enter value into 3rd box, i.e. 90
7. Pick format option using "Format" button. (Yellow fill)
This is what i do. Not too long, but not as speedy as a macro.
2. Format menu
3. Conditional Formatting
4. Leave first box as "Cell value is"
5. Pick condition in next box, i.e. "greater than"
6. Enter value into 3rd box, i.e. 90
7. Pick format option using "Format" button. (Yellow fill)
This is what i do. Not too long, but not as speedy as a macro.
#5
Piece of cake
The conditional formatting answer above is correct. You can setup a simple macro for importing the .csv file too. If you want, e-mail me the CSV file and I'll do it for you. It'll take me about 5 minutes.
Trending Topics
Thread
Thread Starter
Forum
Replies
Last Post
Reggie
Rocky Mountain Discussion
5
02-07-2006 09:29 AM