PDA

View Full Version : VBA recolor fonts to paste into other apps



TrippyTom
05-23-2007, 05:14 PM
I frequently use Blue (0,0,255) and Red (255,0,0) for my Excel data. But I need to paste them as pictures into PPT as Black (0,0,0) yet keep other colors in the table the way they are... so I can't simply go greyscale or black/white.

Is there a way to use VBA to copy/paste a picture and recolor the blue and red fonts to black? Is there a better way to approach this?

Ideally, I would select a range (table) and click a macro button to:
1) copy it
2) place it on the worksheet somewhere as a picture
3) then recolor it

agarwaldvk
05-23-2007, 08:05 PM
TrippyTom

This is a suggestion :-

I take it that you are talking with reference to the colour of the font and not the cell background. But nevertheless!

You, in my opinion, would be better off, by first globally changing the font colour in your worksheet to black using a command like so :-

cells.font.color = RGB(0,0,0)


and t hen copy and paste it in the other application. Then change the color of the desired cells back to where they were. The reason for this being that you would have a greater control on cells in Excel than you would in a picture (or better still parts of a picture, if in the first place you can identify the area of the picture that you are interested in working on) in the other application.

I am presuming here that you are quite familiar with the simple VBA coding that you be required to do the above.

Should you not, please let me know and I shall try and help you further.


Best regards


Deepak
cell background of the entire worksheet

Bob Phillips
05-24-2007, 12:30 AM
If blue and red is good enough for Excel, why is not for PowerPoint? Seems an unnecessary complication to me.

If you must do so though, how about having a copy of that sheet where all blue and red is changed to black, and paste that to Powerpoint.

TrippyTom
05-24-2007, 10:22 AM
Deepak,
I thought of that too, but I don't know how I would know which color to change the fonts back to. How would I keep track of that? I'm only concerned about red and blue fonts (keep other font colors the way they are).

Going with XLD's idea, I guess I could make a new temporary worksheet, paste, change the blue/red and copy that. Thanks XLD, I think you put me on the right track. :)

lucas
05-24-2007, 10:38 AM
Read Bob's post #3
copy the sheet
do what you want to it
delete it.