A
Anddmx
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
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