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 Macro Run-time Error 1004 Application Defined or Object Defined Error

I have Added 3 Sheets to Excel sheets that I use and disable macr
because it wouldnt work with my new sheet.
The purpose of this excel spreed sheet is to count of page in th
boxes.

I added 3 sheets and tried adding in the new code I am no expert so
am looking for some help with the code that I have added on. When
debug, I get Run-time Error 1004 Application Defined or Object Define
Error and stop here.

Example of where the code stops

continuation:

counter = counter + 2
*Stops* --- ActiveCell.Offset(1, -counter).Select.Text

While (ActiveCell.Value < "")

GoTo continuehere


If someone could please guide me in the right direction I would reall
appreciate it.

Thanks

More Code


Sub Record_Page_Count()

Dim Box_number As String
Dim strDocbaseName As String
Dim strUser As String
Dim strPassword As String
Dim strDomain As String
Dim intCount As Integer
Dim pgCounttotal As Integer
Dim pgCount As Integer

'Declare DFC variables
Dim e As IDfException 'Exception object
Dim clientx As IDfClientX 'DFC COM interface object
Dim client As IDfClient 'DFC local client object

Dim loginInfo As IDfLoginInfo

Dim session As IDfSession

Dim q As IDfQuery
Dim col As IDfCollection

Dim strDQL As String

Dim obj As IDfTypedObject

Dim Batch_no As String

Sheets("Boxes").Select
Range("A2").Select
Sheets("ReproMetrics").Select
Rows("3:1000").Select
Selection.ClearContents
Sheets("DailyMetrics").Select
Rows("3:1000").Select
Selection.ClearContents
Sheets("FOMetrics").Select
Rows("3:1000").Select
Selection.ClearContents
Sheets("COMetrics").Select
Rows("3:1000").Select
Selection.ClearContents
Sheets("WCDMetrics").Select
Rows("3:1000").Select
Selection.ClearContents




If (ActiveCell.Value = "REPRO") Then
ActiveCell.Offset(0, 1).Select
Box_number = ActiveCell.Value
Sheets("ReproMetrics").Select
Range("A3").Select
ActiveCell.Value = Box_number
Sheets("Boxes").Select
ActiveCell.Offset(0, 1).Select
While (ActiveCell.Value < "")
counter = counter + 1
Selection.Copy
Sheets("ReproMetrics").Select
ActiveCell.Offset(0, 1).Select
ActiveSheet.Paste
Batch_no = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
GoTo Record_Page_Count

Result_RecordsCount:
ActiveCell.Value = intCount
ActiveCell.Offset(0, 1).Select
GoTo PageCount4
Result_PageCount4:
ActiveCell.Value = pgCounttotal
ActiveCell.Offset(1, -3).Select
ActiveCell.Value = Box_number
Sheets("Boxes").Select
ActiveCell.Offset(0, 1).Select

Wend



ElseIf (ActiveCell.Value = "DAILY") Then

ActiveCell.Offset(0, 1).Select
Box_number = ActiveCell.Value
Sheets("DailyMetrics").Select
Range("A3").Select
ActiveCell.Value = Box_number
Sheets("Boxes").Select
ActiveCell.Offset(0, 1).Select
While (ActiveCell.Value < "")
counter = counter + 1
Selection.Copy
Sheets("DailyMetrics").Select
ActiveCell.Offset(0, 1).Select
ActiveSheet.Paste
Batch_no = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
GoTo Record_Page_Count1

Result_RecordsCount1:
ActiveCell.Value = intCount
ActiveCell.Offset(0, 1).Select
GoTo PageCount5
Result_PageCount5:
ActiveCell.Value = pgCounttotal
ActiveCell.Offset(1, -3).Select
ActiveCell.Value = Box_number
Sheets("Boxes").Select
ActiveCell.Offset(0, 1).Select

Wend

ElseIf (ActiveCell.Value = "CO") Then
ActiveCell.Offset(0, 1).Select
Box_number = ActiveCell.Value
Sheets("COMetrics").Select
Range("A3").Select
ActiveCell.Value = Box_number
Sheets("Boxes").Select
ActiveCell.Offset(0, 1).Select
While (ActiveCell.Value < "")
counter = counter + 1
Selection.Copy
Sheets("COMetrics").Select
ActiveCell.Offset(0, 1).Select
ActiveSheet.Paste
Batch_no = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
GoTo Record_Page_Count8

Result_RecordsCount8:
ActiveCell.Value = intCount
ActiveCell.Offset(0, 1).Select
GoTo PageCount12
Result_PageCount12:
ActiveCell.Value = pgCounttotal
ActiveCell.Offset(1, -3).Select
ActiveCell.Value = Box_number
Sheets("Boxes").Select
ActiveCell.Offset(0, 1).Select

Wend

ElseIf (ActiveCell.Value = "FO") Then
ActiveCell.Offset(0, 1).Select
Box_number = ActiveCell.Value
Sheets("FOMetrics").Select
Range("A3").Select
ActiveCell.Value = Box_number
Sheets("Boxes").Select
ActiveCell.Offset(0, 1).Select
While (ActiveCell.Value < "")
counter = counter + 1
Selection.Copy
Sheets("FOMetrics").Select
ActiveCell.Offset(0, 1).Select
ActiveSheet.Paste
Batch_no = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
GoTo Record_Page_Count9

Result_RecordsCount9:
ActiveCell.Value = intCount
ActiveCell.Offset(0, 1).Select
GoTo PageCount13
Result_PageCount13:
ActiveCell.Value = pgCounttotal
ActiveCell.Offset(1, -3).Select
ActiveCell.Value = Box_number
Sheets("Boxes").Select
ActiveCell.Offset(0, 1).Select


Wend

ElseIf (ActiveCell.Value = "WCD") Then
ActiveCell.Offset(0, 1).Select
Box_number = ActiveCell.Value
Sheets("WCDMetrics").Select
Range("A3").Select
ActiveCell.Value = Box_number
Sheets("Boxes").Select
ActiveCell.Offset(0, 1).Select
While (ActiveCell.Value < "")
counter = counter + 1
Selection.Copy
Sheets("WCDMetrics").Select
ActiveCell.Offset(0, 1).Select
ActiveSheet.Paste
Batch_no = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
GoTo Record_Page_Count16

Result_RecordsCount16:
ActiveCell.Value = intCount
ActiveCell.Offset(0, 1).Select
GoTo PageCount20
Result_PageCount20:
ActiveCell.Value = pgCounttotal
ActiveCell.Offset(1, -3).Select
ActiveCell.Value = Box_number
Sheets("Boxes").Select
ActiveCell.Offset(0, 1).Select
Wend

End If


GoTo continuation




continuation:

counter = counter + 2
ActiveCell.Offset(1, -counter).Select.Text

While (ActiveCell.Value < "")

GoTo continuehere

More code if you need to reply and all post it all


---
Message posted from http://www.ExcelForum.com/

 
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
Run-time error '50290': Application-defined or object-defined erro Macro button Excel Discussion (Misc queries) 1 March 12th 09 10:59 AM
I got this problem run-time error 1004 application defined ... Davide Blau Excel Discussion (Misc queries) 2 July 10th 06 09:27 PM
Macro error : Application-defined or object-defined error Joe Excel Discussion (Misc queries) 3 January 27th 06 02:32 PM
"Run Time Error 1004 Application Defined or Object Defined Error." BJC Excel Programming 4 October 26th 03 03:09 AM
Runtime Error 1004 -- Application Defined or Object Defined Error John[_51_] Excel Programming 3 September 4th 03 04:28 PM


All times are GMT +1. The time now is 09:42 PM.

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"