-
December 13th, 2010, 02:09 PM
#1
Copying cells to new workbook based on cell background....
Hello All,
I have been working away on this problem for several hours and can't seem to get my code to work. I thought someone here might be able to solve it pretty quickly.
I have a workbook (column A:M) which uses conditional formatting for row M. The conditional formatting is different for all of the rows (there are currently over 100, and more might be added). I need to get a macro that will copy all cell values in the row from A:L to a new workbook when the value of M is colored red or yellow.
I was also wondering if it is possible to automatically name the new workbook based on the date.
Thanks for all your help!
Stu
-
December 13th, 2010, 05:13 PM
#2
Re: Copying cells to new workbook based on cell background....
Just record a macro, then open it in the Macro Editor. You will see the VBA code, which is pretty close to VB6, so you can translate it (or post here for help)
We need to see CODE, though
-
December 13th, 2010, 06:01 PM
#3
Re: Copying cells to new workbook based on cell background....
I don't think it's possible to read out a format property of a cell determined by conditional formatting. You'll probably have to track the condition the format is based on yourself, and as apparently that condition can vary from cell to cell you'll likely have no other choice than reading it out of the FormatCondition object that is conatined in the FormatConditions collection that is a property of a Range object (IOW the cell). And as the condition is not (necessarily) stored as an Excel formula, it can't be easily evaluated programmatically (and I don't even recall exactly how this is done at the moment but I could try to research it if it helps).
Sorry that I didn't have more encouraging news.
But anyway... Welcome to CodeGuru!
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
-
December 13th, 2010, 09:12 PM
#4
Re: Copying cells to new workbook based on cell background....
You can read the properties of a cell, formatted or not. Sounds like it's all Excel, anyways!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|