J
Jim Berglund
I'm getting the error at the line with the asterisks. It works when I
replece the variable 'numberofRows' to a number. What am I missing, please?
Private Sub CommandButton2_Click() 'Load Data
Dim numberofRows As Integer, numberofColumns, nextCol As Integer
Application.ScreenUpdating = False
Workbooks("Replacement Strategy5.xls").Activate
Sheets("Raw").Activate
ActiveSheet.Columns("A:BM").Select
Selection.Clear
Selection.Delete Shift:=xlToLeft
Workbooks.Open Filename:= _
"D:\My Documents\ENRV5608\Reports\EMMS
Reports\EMMSReplacement3(EqptData).xls"
Workbooks("EMMSReplacement3(EqptData).xls").Activate
Sheets("Sheet1").Activate
ActiveSheet.Range("A1").Select
numberofRows = ActiveCell.CurrentRegion.Rows.Count
numberofColumns = ActiveCell.CurrentRegion.Columns.Count
** ActiveSheet.Range(Cells(1, 1), Cells(numberofRows,
numberofColumns)).Select**
nextCol = numberofColumns + 2
Selection.Copy
Windows("Replacement Strategy5.xls").Activate
Sheets("YTD BD").Activate
Range("A1").Select
ActiveSheet.Paste
Thanks for any help...
Jim Berglund
replece the variable 'numberofRows' to a number. What am I missing, please?
Private Sub CommandButton2_Click() 'Load Data
Dim numberofRows As Integer, numberofColumns, nextCol As Integer
Application.ScreenUpdating = False
Workbooks("Replacement Strategy5.xls").Activate
Sheets("Raw").Activate
ActiveSheet.Columns("A:BM").Select
Selection.Clear
Selection.Delete Shift:=xlToLeft
Workbooks.Open Filename:= _
"D:\My Documents\ENRV5608\Reports\EMMS
Reports\EMMSReplacement3(EqptData).xls"
Workbooks("EMMSReplacement3(EqptData).xls").Activate
Sheets("Sheet1").Activate
ActiveSheet.Range("A1").Select
numberofRows = ActiveCell.CurrentRegion.Rows.Count
numberofColumns = ActiveCell.CurrentRegion.Columns.Count
** ActiveSheet.Range(Cells(1, 1), Cells(numberofRows,
numberofColumns)).Select**
nextCol = numberofColumns + 2
Selection.Copy
Windows("Replacement Strategy5.xls").Activate
Sheets("YTD BD").Activate
Range("A1").Select
ActiveSheet.Paste
Thanks for any help...
Jim Berglund