Hello Everyone,
Let me start off by saying that the Excel training course that I purchased from MrExcel is the smartest $50.00 I've spent in ten years.
I have two questions based on the codeset depicted below...
Option Explicit
Sub Equipment_Utilization_Report()
' Declare variables...
Dim FinalRow As Integer
'Dim FinalCol As Integer
Dim i As Integer
'Dim j As Integer
' Go to the Equipment Utilization Report page...
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("1st Shift OEE Calculation").Select
Range("B4").Select
' Calculate the length of the form...
FinalRow = Cells(Rows.Count, 2).End(xlUp).Row
'FinalCol = Cells(1, Columns.Count).End(xlToLeft).Column
' Go to the first Press/IMM Call...
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("1st Shift OEE Calculation").Select
Range("D17").Select
'Identify which machines are running per day and add data to the specified fields on the
'Equipment Utilization worksheet.
For i = 17 To FinalRow
Select Case Cells(i, 17)
Case "1750-1"
Case "1450-1"
Case "1450-2"
i = i + 14
End Select
Next i
End Sub
I'm not exiting the Select Case loop when the first value is achieved. The value in the cell in question is supplied from a drop down list. I suspect that I need a value statement but I don't know how to make the statement.
The second question is, once I've matched a case, how do I add a value in a cell to the value contained in a cell on a different page.
By the bye, I suspect that my code is rather clumsey. If you think that this code set is bad you ought to see some others that I wrote.
Anyway, if anyone would be so kind as to educate me I appreciate your effort.
Regards,
FTM
Let me start off by saying that the Excel training course that I purchased from MrExcel is the smartest $50.00 I've spent in ten years.
I have two questions based on the codeset depicted below...
Option Explicit
Sub Equipment_Utilization_Report()
' Declare variables...
Dim FinalRow As Integer
'Dim FinalCol As Integer
Dim i As Integer
'Dim j As Integer
' Go to the Equipment Utilization Report page...
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("1st Shift OEE Calculation").Select
Range("B4").Select
' Calculate the length of the form...
FinalRow = Cells(Rows.Count, 2).End(xlUp).Row
'FinalCol = Cells(1, Columns.Count).End(xlToLeft).Column
' Go to the first Press/IMM Call...
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("1st Shift OEE Calculation").Select
Range("D17").Select
'Identify which machines are running per day and add data to the specified fields on the
'Equipment Utilization worksheet.
For i = 17 To FinalRow
Select Case Cells(i, 17)
Case "1750-1"
Case "1450-1"
Case "1450-2"
i = i + 14
End Select
Next i
End Sub
I'm not exiting the Select Case loop when the first value is achieved. The value in the cell in question is supplied from a drop down list. I suspect that I need a value statement but I don't know how to make the statement.
The second question is, once I've matched a case, how do I add a value in a cell to the value contained in a cell on a different page.
By the bye, I suspect that my code is rather clumsey. If you think that this code set is bad you ought to see some others that I wrote.
Anyway, if anyone would be so kind as to educate me I appreciate your effort.
Regards,
FTM