Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error on sh.Paste sh.Range = ("A1")
First one works (Macro 2000) Second one (same code) doesn't. Error on Sh.Paste sh.Range = ("A1"). Sub Macro2000() ' Dim sh As Worksheet 'copy range from template sheet Sheets("Ind Templates").Rows("38:50").Copy 'for each sheet in workbook after "ind templates" x = Sheets("Ind Templates").Index For Each sh In ThisWorkbook.Sheets If sh.Index x Then 'paste the copied data 1row below the last row used sh.Paste sh.Range("A" & Rows.Count).End(xlUp).Offset(1, 0) End If Next Application.CutCopyMode = False End Sub Sub Macro1000() Dim sh As Worksheet 'copy range from template sheet Sheets("Ind Templates").Rows("1:15").Copy 'for each sheet in workbook after "ind templates" x = Sheets("Ind Templates").Index For Each sh In ThisWorkbook.Sheets If sh.Index x Then 'paste the copied data 1row below the last row used sh.Paste sh.Range = ("A1") End If Next Application.CutCopyMode = False End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error on sh.Paste sh.Range = ("A1")
Sh.Range("A1").Paste "J.W. Aldridge" wrote in message ... First one works (Macro 2000) Second one (same code) doesn't. Error on Sh.Paste sh.Range = ("A1"). Sub Macro2000() ' Dim sh As Worksheet 'copy range from template sheet Sheets("Ind Templates").Rows("38:50").Copy 'for each sheet in workbook after "ind templates" x = Sheets("Ind Templates").Index For Each sh In ThisWorkbook.Sheets If sh.Index x Then 'paste the copied data 1row below the last row used sh.Paste sh.Range("A" & Rows.Count).End(xlUp).Offset(1, 0) End If Next Application.CutCopyMode = False End Sub Sub Macro1000() Dim sh As Worksheet 'copy range from template sheet Sheets("Ind Templates").Rows("1:15").Copy 'for each sheet in workbook after "ind templates" x = Sheets("Ind Templates").Index For Each sh In ThisWorkbook.Sheets If sh.Index x Then 'paste the copied data 1row below the last row used sh.Paste sh.Range = ("A1") End If Next Application.CutCopyMode = False End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error on sh.Paste sh.Range = ("A1")
Error.... object doesnt support this property or method
|
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error on sh.Paste sh.Range = ("A1")
try Sh.Range("A1").PasteSpecial xlAll "Patrick Molloy" wrote in message ... Sh.Range("A1").Paste "J.W. Aldridge" wrote in message ... First one works (Macro 2000) Second one (same code) doesn't. Error on Sh.Paste sh.Range = ("A1"). Sub Macro2000() ' Dim sh As Worksheet 'copy range from template sheet Sheets("Ind Templates").Rows("38:50").Copy 'for each sheet in workbook after "ind templates" x = Sheets("Ind Templates").Index For Each sh In ThisWorkbook.Sheets If sh.Index x Then 'paste the copied data 1row below the last row used sh.Paste sh.Range("A" & Rows.Count).End(xlUp).Offset(1, 0) End If Next Application.CutCopyMode = False End Sub Sub Macro1000() Dim sh As Worksheet 'copy range from template sheet Sheets("Ind Templates").Rows("1:15").Copy 'for each sheet in workbook after "ind templates" x = Sheets("Ind Templates").Index For Each sh In ThisWorkbook.Sheets If sh.Index x Then 'paste the copied data 1row below the last row used sh.Paste sh.Range = ("A1") End If Next Application.CutCopyMode = False End Sub |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error on sh.Paste sh.Range = ("A1")
Hi Jeremy, You can use: For i = x To Sheets.Count Sheets("Ind Templates").Rows("1:15").Copy Sheets(i).Range("A1") Next This is bad syntax: sh.Paste sh.Range = ("A1" But even if it was arranged as sh.Paste sh.Range("A1") It would not work because it is not on the same line as the Copy command. You would have to use PasteSpecial with one of the Paste:=xl constants to access the clipboard and make it paste. I still goof this up once in a while. Look over the examples in the help files and read the remarks. After a while it starts to make sense. "J.W. Aldridge" wrote in message ... Error.... object doesnt support this property or method |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Error: If Range("AZ" & intCounter).Text = "" Then | Excel Programming | |||
Error Help - Method "Range" of object "_Worksheet" failed. | Excel Programming | |||
Shortcut key for "Paste Options" and "Error Checking" buttons? | Excel Discussion (Misc queries) | |||
What is Error "Method "Paste" of object "_Worksheet" failed? | Excel Programming | |||
"Subscript out of range" error for: Workbooks("Test1.xls").Save | Excel Programming |