Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Macro Help - ASAP - Please!

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Macro Help - ASAP - Please!


"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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Macro Help - ASAP - Please!

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Macro Help - ASAP - Please!

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Macro Help - ASAP - Please!

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Macro Help - ASAP - Please!

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Macro Help - ASAP - Please!

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Macro Help - ASAP - Please!

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default Macro Help - ASAP - Please!

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Macro Help - ASAP - Please!

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
NEED HELP ASAP PLEASE!! Dragon Blood Excel Discussion (Misc queries) 7 January 25th 08 03:58 PM
Simple Help ASAP macro to fill range... Stephen Excel Programming 4 February 9th 07 12:09 PM
How can I save the formulas when running a macro? Need ASAP!! MLP Excel Discussion (Misc queries) 2 November 14th 06 07:50 PM
Need Help ASAP bigwilly11189 Excel Programming 1 September 29th 05 02:56 AM
Add a form onto a macro - Need help ASAP TMO Excel Programming 2 December 13th 03 05:10 PM


All times are GMT +1. The time now is 09:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"