LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default 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
 
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
Error: If Range("AZ" & intCounter).Text = "" Then [email protected] Excel Programming 7 January 21st 08 02:38 PM
Error Help - Method "Range" of object "_Worksheet" failed. Alan Smith Excel Programming 3 March 15th 07 06:55 PM
Shortcut key for "Paste Options" and "Error Checking" buttons? johndog Excel Discussion (Misc queries) 1 October 6th 06 11:56 AM
What is Error "Method "Paste" of object "_Worksheet" failed? vat Excel Programming 7 February 17th 06 08:05 PM
"Subscript out of range" error for: Workbooks("Test1.xls").Save Just12341234 Excel Programming 2 June 17th 05 03:16 PM


All times are GMT +1. The time now is 10:34 AM.

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

About Us

"It's about Microsoft Excel"