ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy format without copy & paste (https://www.excelbanter.com/excel-programming/302859-copy-format-without-copy-paste.html)

Gunnar Johansson

Copy format without copy & paste
 
Hi,
I have merged cells , let's say in sheet1:
Reference A10 has MergeArea "A10:A14"

I want to have the same format on a similar merged area in sheet2: "B10:B14"

Now the procedure is a copy - paste solution, but I doesn't like that.

How can I "transfere" the format?

Thanks for any help!




Gunnar Johansson

Copy format without copy & paste
 
Maybe I should tell the format to transfere is in the visual way (frame,
background, font etc.

It should NOT transfere number format, date format, percent etc.

/Regards


"Gunnar Johansson" skrev i meddelandet
...
Hi,
I have merged cells , let's say in sheet1:
Reference A10 has MergeArea "A10:A14"

I want to have the same format on a similar merged area in sheet2:

"B10:B14"

Now the procedure is a copy - paste solution, but I doesn't like that.

How can I "transfere" the format?

Thanks for any help!






Jim May

Copy format without copy & paste
 
How bout using the Format-Painter (Icon) method?

"Gunnar Johansson" wrote in message
...
Hi,
I have merged cells , let's say in sheet1:
Reference A10 has MergeArea "A10:A14"

I want to have the same format on a similar merged area in sheet2:

"B10:B14"

Now the procedure is a copy - paste solution, but I doesn't like that.

How can I "transfere" the format?

Thanks for any help!






Gunnar Johansson

That's a copy & paste method (PasteSpecial)...
 
It has to be in VBA.
/Regards


"Jim May" skrev i meddelandet
news:inxEc.20765$WI2.14551@lakeread05...
How bout using the Format-Painter (Icon) method?

"Gunnar Johansson" wrote in message
...
Hi,
I have merged cells , let's say in sheet1:
Reference A10 has MergeArea "A10:A14"

I want to have the same format on a similar merged area in sheet2:

"B10:B14"

Now the procedure is a copy - paste solution, but I doesn't like that.

How can I "transfere" the format?

Thanks for any help!








david mcritchie

That's a copy & paste method (PasteSpecial)...
 
And recording a macro works or not?
copy and paste, special to do the formatting

Sub Macro1()
Range("A10:A14").Select
Selection.Copy
Sheets("Sheet2").Select
Range("A10").Select
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub

Sub Macro1()
Sheets("sheet1").Range("A10:A14").Copy
Sheets("Sheet2").Range("b10").PasteSpecial Paste:=xlFormats, _
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Gunnar Johansson" wrote in message ...
It has to be in VBA.
/Regards


"Jim May" skrev i meddelandet
news:inxEc.20765$WI2.14551@lakeread05...
How bout using the Format-Painter (Icon) method?

"Gunnar Johansson" wrote in message
...
Hi,
I have merged cells , let's say in sheet1:
Reference A10 has MergeArea "A10:A14"

I want to have the same format on a similar merged area in sheet2:

"B10:B14"

Now the procedure is a copy - paste solution, but I doesn't like that.

How can I "transfere" the format?

Thanks for any help!










Gunnar Johansson

Thanks! But it is already a Sub/procedure/macro like yours...
 
Hi David,

Thank you for your effort! I'm sorry if I described unclearly. I have a
procedure in a sheet module now, using copy-paste like you've written down
for me now. There is a lot of rows divided on several different areas, so
there is a lot of code now and I feel I'm loosing control and speed.
Therefore, I wondered if there is an other way than copy-paste in the
Sub/procedure/

Hope this will clarify,

Regards



"David McRitchie" skrev i meddelandet
...
And recording a macro works or not?
copy and paste, special to do the formatting

Sub Macro1()
Range("A10:A14").Select
Selection.Copy
Sheets("Sheet2").Select
Range("A10").Select
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub

Sub Macro1()
Sheets("sheet1").Range("A10:A14").Copy
Sheets("Sheet2").Range("b10").PasteSpecial Paste:=xlFormats, _
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Gunnar Johansson" wrote in message

...
It has to be in VBA.
/Regards


"Jim May" skrev i meddelandet
news:inxEc.20765$WI2.14551@lakeread05...
How bout using the Format-Painter (Icon) method?

"Gunnar Johansson" wrote in message
...
Hi,
I have merged cells , let's say in sheet1:
Reference A10 has MergeArea "A10:A14"

I want to have the same format on a similar merged area in sheet2:
"B10:B14"

Now the procedure is a copy - paste solution, but I doesn't like

that.

How can I "transfere" the format?

Thanks for any help!













All times are GMT +1. The time now is 12:01 AM.

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