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: 18
Default code not working correctly

Can anyone tell me why this code is not working? It always gives me a VB
error when it gets to: Range.Select = ("A2:I27")

All I want to do is copy that range from one excel file to another file.

Private Sub CommandButton1_Click()
'phil
ChDir "\\eeroch1nas02\home\CapursoP\Stats\temp"
Workbooks.Open Filename:= _
"\\eeroch1nas02\home\CapursoP\Stats\temp\Agent work share.xls"
Windows("Agent work share.xls").Activate
Sheets("Phil").Select
Range.Select = ("A2:I27")
Selection.Copy
Windows("Agent work share totals template - Version 2.xls").Activate
Sheets("Phil").Select
Range("A2").Select
ActiveSheet.Paste
Range("J2").Select
Windows("Agent work share.xls").Activate
Application.CutCopyMode = False
ActiveWindow.Close
End Sub


Thanks,
Phil
 
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
Macro not working correctly Andy_N1708 via OfficeKB.com Excel Discussion (Misc queries) 3 May 27th 10 03:35 AM
Formulas not working correctly Curt D. Excel Worksheet Functions 6 November 1st 07 08:48 PM
SUM formula not working correctly Kim Excel Worksheet Functions 1 November 1st 07 03:45 PM
Autofilter not working correctly... Emily Excel Discussion (Misc queries) 0 January 11th 06 10:37 PM
Column find code not working correctly Todd Huttenstine Excel Programming 2 November 16th 04 09:18 PM


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