Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have this macro which works great.
But I need to ALSO copy/paste the format of the cells Sub Macro1() Sheets("Sheet1").Rows("1:1").Copy Sheets("Sheet2").Rows("3:5").PasteSpecial Paste:=xlPasteValidation, _ Operation:=xlNone, SkipBlanks:=False, Transpose:=False End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Theo" skrev i en meddelelse ... I have this macro which works great. But I need to ALSO copy/paste the format of the cells Sub Macro1() Sheets("Sheet1").Rows("1:1").Copy Sheets("Sheet2").Rows("3:5").PasteSpecial Paste:=xlPasteValidation, _ Operation:=xlNone, SkipBlanks:=False, Transpose:=False End Sub Hi Theo Substitute "Paste:=xlPasteValidation" with "Paste:=xlPasteAll" //Per |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
But I only want to paste the validation and the format?
"Per Jessen" wrote: "Theo" skrev i en meddelelse ... I have this macro which works great. But I need to ALSO copy/paste the format of the cells Sub Macro1() Sheets("Sheet1").Rows("1:1").Copy Sheets("Sheet2").Rows("3:5").PasteSpecial Paste:=xlPasteValidation, _ Operation:=xlNone, SkipBlanks:=False, Transpose:=False End Sub Hi Theo Substitute "Paste:=xlPasteValidation" with "Paste:=xlPasteAll" //Per |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
VBA PasteSpecial does not support what you want to do in a single action.
You will have to to accomplish it in a secondary action. "Theo" wrote: But I only want to paste the validation and the format? "Per Jessen" wrote: "Theo" skrev i en meddelelse ... I have this macro which works great. But I need to ALSO copy/paste the format of the cells Sub Macro1() Sheets("Sheet1").Rows("1:1").Copy Sheets("Sheet2").Rows("3:5").PasteSpecial Paste:=xlPasteValidation, _ Operation:=xlNone, SkipBlanks:=False, Transpose:=False End Sub Hi Theo Substitute "Paste:=xlPasteValidation" with "Paste:=xlPasteAll" //Per |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Theo,
This should do it Sub Macro1() Sheets("Sheet1").Rows("1:1").Copy Sheets("Sheet2").Rows("3:5").PasteSpecial End Sub Mike "Theo" wrote: I have this macro which works great. But I need to ALSO copy/paste the format of the cells Sub Macro1() Sheets("Sheet1").Rows("1:1").Copy Sheets("Sheet2").Rows("3:5").PasteSpecial Paste:=xlPasteValidation, _ Operation:=xlNone, SkipBlanks:=False, Transpose:=False End Sub |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
But I only want to paste the validation and the format?
"Mike H" wrote: Theo, This should do it Sub Macro1() Sheets("Sheet1").Rows("1:1").Copy Sheets("Sheet2").Rows("3:5").PasteSpecial End Sub Mike "Theo" wrote: I have this macro which works great. But I need to ALSO copy/paste the format of the cells Sub Macro1() Sheets("Sheet1").Rows("1:1").Copy Sheets("Sheet2").Rows("3:5").PasteSpecial Paste:=xlPasteValidation, _ Operation:=xlNone, SkipBlanks:=False, Transpose:=False End Sub |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't want it to paste all - just the validation and the format.
"Theo" wrote: I have this macro which works great. But I need to ALSO copy/paste the format of the cells Sub Macro1() Sheets("Sheet1").Rows("1:1").Copy Sheets("Sheet2").Rows("3:5").PasteSpecial Paste:=xlPasteValidation, _ Operation:=xlNone, SkipBlanks:=False, Transpose:=False End Sub |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Paste it twice
Sheets("Sheet1").Rows("1:1").Copy Sheets("Sheet2").Rows("3:5").PasteSpecial Paste:=xlPasteValidation, _ Operation:=xlNone, SkipBlanks:=False, Transpose:=False Sheets("Sheet2").Rows("3:5").PasteSpecial Paste:=xlPasteFormats Theo wrote: I have this macro which works great. But I need to ALSO copy/paste the format of the cells Sub Macro1() Sheets("Sheet1").Rows("1:1").Copy Sheets("Sheet2").Rows("3:5").PasteSpecial Paste:=xlPasteValidation, _ Operation:=xlNone, SkipBlanks:=False, Transpose:=False End Sub -- Dave Peterson |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
just add another line of code:
Sub Macro1() Sheets("Sheet1").Rows("1:1").Copy With Sheets("Sheet2").Rows("3:5") .PasteSpecial Paste:=xlPasteValidation, _ Operation:=xlNone, SkipBlanks:=False, Transpose:=False .PasteSpecial Paste:=xlPasteFormats, _ Operation:=xlNone, SkipBlanks:=False, Transpose:=False End With End Sub -- Gary "Theo" wrote in message ... I have this macro which works great. But I need to ALSO copy/paste the format of the cells Sub Macro1() Sheets("Sheet1").Rows("1:1").Copy Sheets("Sheet2").Rows("3:5").PasteSpecial Paste:=xlPasteValidation, _ Operation:=xlNone, SkipBlanks:=False, Transpose:=False End Sub |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Cool - I had tried repeating it, but I did not have the End With statement -
I'll try that! Thanks! "Gary Keramidas" wrote: just add another line of code: Sub Macro1() Sheets("Sheet1").Rows("1:1").Copy With Sheets("Sheet2").Rows("3:5") .PasteSpecial Paste:=xlPasteValidation, _ Operation:=xlNone, SkipBlanks:=False, Transpose:=False .PasteSpecial Paste:=xlPasteFormats, _ Operation:=xlNone, SkipBlanks:=False, Transpose:=False End With End Sub -- Gary "Theo" wrote in message ... I have this macro which works great. But I need to ALSO copy/paste the format of the cells Sub Macro1() Sheets("Sheet1").Rows("1:1").Copy Sheets("Sheet2").Rows("3:5").PasteSpecial Paste:=xlPasteValidation, _ Operation:=xlNone, SkipBlanks:=False, Transpose:=False End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
NEED HELP ASAP PLEASE!! | Excel Discussion (Misc queries) | |||
Simple Help ASAP macro to fill range... | Excel Programming | |||
How can I save the formulas when running a macro? Need ASAP!! | Excel Discussion (Misc queries) | |||
Need Help ASAP | Excel Programming | |||
Add a form onto a macro - Need help ASAP | Excel Programming |