I may have some overkill here but I'm just trying to figure out why my VLookup Function gives me an error? Any help would be great.
rib
Sub Get_Numbers()
Dim ClockNumbers As Range
Dim x As Long, r As Long, shift As String
Dim lrow As Long, clocknumber As String
Dim numparts As Double, numscrap As Double
Sheets("Week52"
.Activate
lrow = Rows.Cells(Rows.count, 59).End(xlUp).Row
Set ClockNumbers = Range(Cells(2, 59), Cells(lrow, 60))
lrow = Empty
r = 2
For x = 1 To Sheets.count
Sheets(x).Activate
lrow = Rows.Cells(Rows.count, 2).End(xlUp).Row
Do While r <> lrow + 1
Cells(r, 2).Activate
clocknumber = ActiveCell.Value
If IsNumeric(clocknumber) Then
shift = Application.WorksheetFunction.VLookup(clocknumber, ClockNumbers, 2, True)
r = r + 1
Else
End If
r = r + 1
Loop
Next x
End Sub
I know a little about nothing and even less about everything.
rib
Sub Get_Numbers()
Dim ClockNumbers As Range
Dim x As Long, r As Long, shift As String
Dim lrow As Long, clocknumber As String
Dim numparts As Double, numscrap As Double
Sheets("Week52"
lrow = Rows.Cells(Rows.count, 59).End(xlUp).Row
Set ClockNumbers = Range(Cells(2, 59), Cells(lrow, 60))
lrow = Empty
r = 2
For x = 1 To Sheets.count
Sheets(x).Activate
lrow = Rows.Cells(Rows.count, 2).End(xlUp).Row
Do While r <> lrow + 1
Cells(r, 2).Activate
clocknumber = ActiveCell.Value
If IsNumeric(clocknumber) Then
shift = Application.WorksheetFunction.VLookup(clocknumber, ClockNumbers, 2, True)
r = r + 1
Else
End If
r = r + 1
Loop
Next x
End Sub
I know a little about nothing and even less about everything.