Two Questions

FTM

New Member
Joined
Mar 28, 2013
Messages
40
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
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Should you be looking in (i,4) ie column D?

then

sheets(2).cells(1,4).value = sheet(2).cells(i,4).value + sheets(1).cells(3,1).value for instance.
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,435
Members
448,962
Latest member
Fenes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top