Copy Column and Paste

G

Guest

Im using the following macro

Sub AddColumnt(
ActiveCell.Offset(0, 1).EntireColumn.Inser
Range("A1:A10").Copy ActiveCell.Offset(0, 1
End Su
It copies A1:A10 and inserts column and paste next to active cell

Cell A5 has a formula as well as conditional formatting using isformula UDF. The cell is colored yellow and if there is a formula it is white, so at the time of copy it is white. (Im' trying to see that user has over tpyed foormula). The copy picks up the CF but it doesnt pick up the cell color. Seems as though I can get the formula and the CF but not the cell color. What can I add to pick up that color as well as the CF

Many Thank
Steve
 
T

Tom Ogilvy

Conditional formatting produces a color based on the condition in the
formula. So if you want the color, you need to reproduce the conditions
that produce it. If your formula is absolute, it should evaluate to the
same condition as A5. If not, then it won't - it will look relative to its
current location.

--
Regards,
Tom Ogilvy




steveh said:
Im using the following macro

Sub AddColumnt()
ActiveCell.Offset(0, 1).EntireColumn.Insert
Range("A1:A10").Copy ActiveCell.Offset(0, 1)
End Sub
It copies A1:A10 and inserts column and paste next to active cell.

Cell A5 has a formula as well as conditional formatting using isformula
UDF. The cell is colored yellow and if there is a formula it is white, so
at the time of copy it is white. (Im' trying to see that user has over tpyed
foormula). The copy picks up the CF but it doesnt pick up the cell color.
Seems as though I can get the formula and the CF but not the cell color.
What can I add to pick up that color as well as the CF.
 
G

Guest

So....I have a formula in A5 and the cell meets CF and is white (which is good) and that is copied over by the macro. But when the formula is deleted out of the column that is copied and pasted it doesnot change to the 'base' (yellow) color of the copied cell. I guees Im correct in saying that I can't have the CF and the base color as well? Maybe mamma was right when she said I cant have my cake and eat it too?
Thanks!!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top