ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy Column and Paste (https://www.excelbanter.com/excel-programming/289926-copy-column-paste.html)

steveh[_3_]

Copy Column and Paste
 
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

Tom Ogilvy

Copy Column and Paste
 
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 wrote in message
...
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.

Many Thanks
Steve




steveh[_3_]

Copy Column and Paste
 
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!!!!


All times are GMT +1. The time now is 03:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com