Setting Excel cell formats from Access VBA

  • Thread starter Thread starter AndrewDB
  • Start date Start date
A

AndrewDB

Hi All. I need to export data to an Excel spreadsheet and set the cell
backcolors depending on the data values. Hoe do I set the cell backcolors?
Thanks

Regards
 
Are you trying to export to a new spreadsheet or one that is already created?


If you are exporting to an already created one, you should be able to use
the "conditional formatting" options to set the bgcolors and fonts. Last
time I did an export to excel with conditional formatting already set, I
didn't lose the formatting conditionals.

If you are exporting to a new spreadsheet, I'm afraid I am of no assistance
there.
 
Hi JH

I am exporting to a new spreadsheet. Just a thought - If I set the formating
of a cell in a spreadsheet (using RGB colours) that I can use as a template,
will I be able to copy that backcolor to the cell I want to use?

Regards
 
Hi Doug,

I've downloaded and looked at your example. So thats what MVP means!!
(M)ost (V)ery im(P)ressed!!

Just kidding. The example is a great help. But still could not solve my
problem.
My question - Is there a way to set the cell backcolor using a RGB value?

Best Regards
 
While I didn't have a specific example of that particular piece of
formatting, I thought the article told you how to do whatever you needed to
do by recording a macro in Excel that does it and looking at the VBA
generated by that.
 
Back
Top