ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Bring in cell format (https://www.excelbanter.com/excel-discussion-misc-queries/237305-re-bring-cell-format.html)

Don Guillett

Bring in cell format
 
A simple example

Sub findcopyincludingformat()
Columns(1).Find(2).Copy
Range("b2").PasteSpecial xlPasteAll
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message news:...
A formula may only return a value, not a format. macro required.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"prender" wrote in message
...
If I write a formula in a cell such as "=VLOOKUP(F9,Vacation_initials,2)"
to
bring in the contents of a cell on another worksheet, is there a way to
also
bring along the formatting of that cell? In this case, I'm choosing
from a
range of 256 cells each of which has a different format.




Rick Rothstein

Bring in cell format
 
Or you could do it without the PasteSpecial call by copying directly to the
destination...

Sub findcopyincludingformat()
Columns(1).Find(2).Copy Range("b2")
End Sub

--
Rick (MVP - Excel)


"Don Guillett" wrote in message
...
A simple example

Sub findcopyincludingformat()
Columns(1).Find(2).Copy
Range("b2").PasteSpecial xlPasteAll
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message news:...
A formula may only return a value, not a format. macro required.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"prender" wrote in message
...
If I write a formula in a cell such as
"=VLOOKUP(F9,Vacation_initials,2)" to
bring in the contents of a cell on another worksheet, is there a way to
also
bring along the formatting of that cell? In this case, I'm choosing
from a
range of 256 cells each of which has a different format.






All times are GMT +1. The time now is 11:39 AM.

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