Hi All,
I have been banging my head against a wall with this one. The script works fine but I still get the type mismatch error. I have looked up solutions to this issue with adding Val and .Value and IsNumeric but to no avail. I need the error to go away as when it goes to the user i can't have error messages popping up.
Here is the script;
Function Pallet_Marker()
Dim rng As Range
'*Whole Numbers*
For Each aCell In Range("I16:I35")
If Int(aCell) = aCell And Not IsEmpty(aCell.Value) Then
'2 pals 2specs
If Val(aCell.Value) = 1 And (Range(Cells(aCell.Row + 1, aCell.Column), aCell.End(xlDown))) = 1 Then
Set dCell = Range(Cells(aCell.Row + 1, aCell.Column), aCell.End(xlDown))
Call wbookmark3
'Multiple
ElseIf aCell >= 2 Then
Call wbookmark2
Else
'Single
If aCell = 1 Then
Call wbookmark1
End If
End If
End If
Next
'*Decimals*
For Each aCell In Range("I16")
If aCell.Value <> Int(aCell.Value) Then
'halves
If Cells(36, 13).Value = 2 Then
Set bCell = Range(Cells(aCell.Row + 1, aCell.Column), aCell.End(xlDown))
Call wbookmarkDec2
'thirds
ElseIf Cells(36, 13).Value = 3 Then
Set bCell = Range(Cells(aCell.Row + 1, aCell.Column), aCell.End(xlDown))
Set cCell = Range(Cells(bCell.Row + 1, bCell.Column), bCell.End(xlDown))
Call wbookmarkDec3
Else
'partial single
If Cells(36, 13).Value < 2 Then
wbookmarkDec
End If
End If
End If
Next
End Function
Any help would be great!!
Bookmarks