Thanks to rbrhodes who provided the solutions listed below.
Both procedures work and produce the desired results.
Here's the simplistic way:
VBA:
Private Sub CommandButton1_Click()
'Opens workbook
Workbooks.Open Filename:="C:\Documents and Settings\Administrator\Desktop\Sizzler\Inventory\WalkRoutes.xlsx"
'//Not needed. Workbook is active when opened 'Workbooks("walkroutes.xlsx").Activate
'//Not really needed either 'Sheets("WalkRoute").Activate
'//Replace sheet name and range address
ActiveWorkbook.Sheets("Walkroute").Range("A1:G205").Copy Workbooks("Updates").Sheets("PutNameHere").Range("PutAddressHere")
and here's a better way
VBA:
Option Explicit
Sub ImBetter()
Dim WSdest As Range
Dim WSsource As Worksheet
'Create object with workbook 'Updates'
Set WSdest = ActiveWorkbook.Sheets("P").Range("A1")
'Opens workbook
Workbooks.Open Filename:="C:\Documents and Settings\Administrator\Desktop\Sizzler\Inventory\WalkRoutes.xlsx"
'Create object with worksheet 'walkroute'
Set WSsource = ActiveWorkbook.Sheets("walkroute")
'Copy with destination
WSsource.Range("A1:G205").Copy WSdest
'Destroy objects
Set WSdest = Nothing
Set WSsource = Nothing
End Sub
I'd like to thank all who worked on this for their time and effort.
Being new to the forums I didn't realize about the cross posting issues and implications. Please accept my sincere apology.
Thanks to all.
Bookmarks