ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   formatting question (https://www.excelbanter.com/excel-programming/376588-formatting-question.html)

JOUIOUI

formatting question
 
I'm copying data to a spreadsheet every day with a macro. When the data is
copied to the new WB, it carries over the font formattng and sheet formating
of the original WB. Is there code I can use format a column and font from
row 19458 and forward.














Jim Jackson

formatting question
 
If you want to preserve the formats already present in the new WB you can use
Selection.PasteSpecial Paste:=xlPasteValues

--
Best wishes,

Jim


"JOUIOUI" wrote:

I'm copying data to a spreadsheet every day with a macro. When the data is
copied to the new WB, it carries over the font formattng and sheet formating
of the original WB. Is there code I can use format a column and font from
row 19458 and forward.














Gary Brown

formatting question
 
Instead of...
ActiveSheet.Paste
try
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
That will stop the formatting from being copied over.
--
HTH,
Gary Brown

If this post was helpful to you, please select ''YES'' at the bottom of the
post.



"JOUIOUI" wrote:

I'm copying data to a spreadsheet every day with a macro. When the data is
copied to the new WB, it carries over the font formattng and sheet formating
of the original WB. Is there code I can use format a column and font from
row 19458 and forward.














JOUIOUI

formatting question
 
Yikes, this is not working, what am I doing wrong? I treid it with Selection
and now with rng1 and both times it failed. Thanks

rng1.Copy rng3.Offset(0, 0)
rng1.PasteSpecial Paste:=xlPasteValues


"Jim Jackson" wrote:

If you want to preserve the formats already present in the new WB you can use
Selection.PasteSpecial Paste:=xlPasteValues

--
Best wishes,

Jim


"JOUIOUI" wrote:

I'm copying data to a spreadsheet every day with a macro. When the data is
copied to the new WB, it carries over the font formattng and sheet formating
of the original WB. Is there code I can use format a column and font from
row 19458 and forward.















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

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