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 help

I am trying to get data from cells on sheets "boxes" and have date pu
on its own sheets "Reprometrics"ect and then add up the pages an
boxes. The code has no compile errors but when it comes to the end of
row it just stops and wont continue.I need it to go to the next row an
select the boxes and add up the page count but it wont LOL.

Need some help on figuring out how to pick the right formula.

Thanks

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("ReproMetrics").Select
Rows("3:1000").Select
Selection.ClearContents
Sheets("DailyMetrics").Select
Rows("3:1000").Select
Selection.ClearContents
Sheets("COMetrics").Select
Rows("3:1000").Select
Selection.ClearContents
Sheets("Boxes").Select
Range("A2").Select

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



If (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 PageCount10
Result_PageCount10:
ActiveCell.Value = pgCounttotal
ActiveCell.Offset(1, -3).Select
ActiveCell.Value = Box_number
Sheets("Boxes").Select
ActiveCell.Offset(1, 1).Select

Wend



End If


GoTo continuation




continuation:

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

While (ActiveCell.Value < "")

GoTo continuehere

Wend

GoTo jumpout




continuehe



If (ActiveCell.Value = "REPRO") Then
ActiveCell.Offset(0, 1).Select
Box_number = ActiveCell.Value
Sheets("ReproMetrics").Select
ActiveCell.Value = Box_number
Sheets("Boxes").Select
ActiveCell.Offset(0, 1).Select
counter = 0
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_Count2

Result_RecordsCount2:
ActiveCell.Value = intCount
ActiveCell.Offset(0, 1).Select
GoTo PageCount6
Result_PageCount6:
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
ActiveCell.Value = Box_number
Sheets("Boxes").Select
ActiveCell.Offset(0, 1).Select
counter = 0
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_Count3

Result_RecordsCount3:
ActiveCell.Value = intCount
ActiveCell.Offset(0, 1).Select
GoTo PageCount7
Result_PageCount7:
ActiveCell.Value = pgCounttotal
ActiveCell.Offset(1, -3).Select
ActiveCell.Value = Box_number
Sheets("Boxes").Select
ActiveCell.Offset(0, 1).Select

Wend

If (ActiveCell.Value = "CO") Then
ActiveCell.Offset(0, 1).Select
Box_number = ActiveCell.Value
Sheets("COMetrics").Select
ActiveCell.Value = Box_number
Sheets("Boxes").Select
ActiveCell.Offset(0, 1).Select
counter = 0
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_Count9

Result_RecordsCount9:
ActiveCell.Value = intCount
ActiveCell.Offset(0, 1).Select
GoTo PageCount11
Result_PageCount11:
ActiveCell.Value = pgCounttotal
ActiveCell.Offset(1, -3).Select
ActiveCell.Value = Box_number
Sheets("Boxes").Select
ÿ¾¼,


---
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
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


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