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: 1
Default Copying 2nd Sheet


Hello,

I'm still having a problem copying sheet 2, in this code (named card
to the opened workbook.

Here's the code I'm working on. When I run it, I get "Subscript Out O
Range".
It runs then stops on the added worksheet, but on sheet 1.

Please, have a look:

[color=RoyalBlue]Sub test()

Columns("A:I").Copy
Workbooks.Add
Columns("A:I").PasteSpecial Paste:=xlPasteFormats
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone
SkipBlanks _
:=False, Transpose:=False
Range("D1").Select
Application.CutCopyMode = False

Workbooks(SolidWorksheet).Activate
Sheets("card").Select
Columns("A:I").Copy
Workbooks(Book13).Activate
Sheets("Sheet2").Select
Columns("A:I").PasteSpecial Paste:=xlPasteFormats
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone
SkipBlanks _
:=False, Transpose:=False
Range("D1").Select
Application.CutCopyMode = False
Sheets("Sheets1").Select

ActiveWorkbook.SaveAs Filename:= _
"c:\Books\" & Format(Date, "mm-dd-yyyy") & " Sunday Worksheet.xls
' _
FileFormat:=xlNormal, Password:="", WriteResPassword:=""' _
ReadOnlyRecommend:=False, CreateBackup:=False
ActiveWorkbook.Close
returnvalue = MsgBox("Don't Forget To Put All Deposit Slips In Th
Book", 64, "Secretary's Message")
If returnvalue = 1 Then 'User chose OK

End If
End Sub

Thanks,
EMo

--
EMo
-----------------------------------------------------------------------
EMoe's Profile: http://www.excelforum.com/member.php...fo&userid=2318
View this thread: http://www.excelforum.com/showthread.php?threadid=37414

 
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 Taking alot data from one sheet (if not blank) and copying toa list on another sheet. Alex Zuniga Excel Worksheet Functions 1 November 25th 09 11:54 PM
Copying the repeated data of the previous sheet to the next sheet Sasikiran Excel Discussion (Misc queries) 1 September 25th 07 03:18 PM
Dynamic column chart - copying from Sheet to Sheet. Marko Pinteric Excel Discussion (Misc queries) 1 April 10th 06 12:57 PM
Dynamic column chart - copying from Sheet to Sheet. Marko Pinteric Charts and Charting in Excel 1 April 10th 06 12:57 PM
2 questions, copying data from sheet to sheet and assigning macro Boris Excel Worksheet Functions 0 December 16th 04 06:11 PM


All times are GMT +1. The time now is 01:53 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"