ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy Formatting of Cell (https://www.excelbanter.com/excel-programming/298335-re-copy-formatting-cell.html)

Frank Kabel

Copy Formatting of Cell
 
Hi
not possible with formulas/user defined functions as they can only
return values

--
Regards
Frank Kabel
Frankfurt, Germany

"WintonCW" schrieb im Newsbeitrag
...
I am copying data from one sheet to another. I have used the

=VLOOKUP () to find the data which is working nicely. However, is
there any way to copy the formatting of the entire cell that I've found
(ie -- background color)? I'm guessing I"ll have to write my own
macro, so any help on this would be greatly appreciated. Thank you!




WintonCW[_2_]

Copy Formatting of Cell
 
All right -- any suggestions for what to do? I'm pretty hesitant to copy each cell's characteristic individually as this is a sizeable -- and variable -- sheet.

Thank you

Frank Kabel

Copy Formatting of Cell
 
Hi
if you want to copy the formats for many cells you may have a look at
'Edit - Paste Special - Formats'. If this is not what you're looking
for you may explain with some more detail how you ant to copy and if
this is a one-time operation of if you want to change the formats
automatically if the source formats changes

--
Regards
Frank Kabel
Frankfurt, Germany

"WintonCW" schrieb im Newsbeitrag
...
All right -- any suggestions for what to do? I'm pretty hesitant to

copy each cell's characteristic individually as this is a sizeable --
and variable -- sheet.

Thank you



Corey Winton

Copy Formatting of Cell
 
I ended up finally writing a macro that would do the trick:


'fromCell is found using a Cells.Find()
'toCell is assigned

Sub Fill(fromCell, toCell)
With toCell
.Value = fromCell.Value
.Interior.ColorIndex = fromCell.Interior.ColorIndex
.Interior.Pattern = fromCell.Interior.Pattern
End With
End Sub

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 05:12 PM.

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