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: 41
Default Peculiar Runtime Error 1004

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").Activa te
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


 
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
runtime error 1004 valdesd Excel Discussion (Misc queries) 0 October 12th 05 05:30 PM
Runtime Error '1004' [email protected] Excel Discussion (Misc queries) 2 July 18th 05 06:10 AM
runtime error 1004 monika Excel Programming 3 February 11th 04 09:48 AM
Runtime Error 1004 Don[_7_] Excel Programming 2 September 16th 03 08:32 AM
runtime error 1004 Adella Excel Programming 2 July 29th 03 08:07 PM


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