ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MACRO Help (https://www.excelbanter.com/excel-programming/404196-macro-help.html)

theo

MACRO Help
 
Can a macro be created to

1. copy a row from worksheet 1 (which is protected)
2. paste to worksheet 2 beginning with row 3, but paste validation ONLY

Is this possible? and if so, does anyone have sample code?
Thanks

merjet

MACRO Help
 
Sub Macro1()
Sheets("Sheet1").Rows("1:1").Copy
Sheets("Sheet2").Rows("3:5").PasteSpecial
Paste:=xlPasteValidation, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End Sub

Hth,
Merjet


theo

MACRO Help
 
This looks perfect - I copied it and ran it, but it gives me a syntax error
and hi-lites in red:
Paste:=xlPasteValidation, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False

Can you tell what I'm doing wrong?
Thanks!

"merjet" wrote:

Sub Macro1()
Sheets("Sheet1").Rows("1:1").Copy
Sheets("Sheet2").Rows("3:5").PasteSpecial
Paste:=xlPasteValidation, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End Sub

Hth,
Merjet



merjet

MACRO Help
 
The 3rd line was broken during posting.

Move "Paste:=xlPasteValidation, _ " by
appending it to the line above it.

Hth,
Merjet

theo

MACRO Help
 
Yahoo! That worked!!
Thank you so much.
T

"merjet" wrote:

The 3rd line was broken during posting.

Move "Paste:=xlPasteValidation, _ " by
appending it to the line above it.

Hth,
Merjet



All times are GMT +1. The time now is 03:35 AM.

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