Rdhostetler
New Member
- Joined
- Feb 2, 2015
- Messages
- 34
hello
i have some code that is supposed to look at a specified sheet and figure out how many active rows it has and then look at column D and check each cell in that column to see if any are over 55. if any cell is over 55 it will give a message box as you can see... with this code it is giving me the message box even though i dont have any over 55. any help would be appreciated.
thanks
i have some code that is supposed to look at a specified sheet and figure out how many active rows it has and then look at column D and check each cell in that column to see if any are over 55. if any cell is over 55 it will give a message box as you can see... with this code it is giving me the message box even though i dont have any over 55. any help would be appreciated.
thanks
Code:
Private Sub check_screen_width()
'check screen widths on order
Dim width As Long
numrows = Sheet17.Range("d1", Sheet17.Range("d1").End(xlDown)).Rows.Count
For width = 1 To numrows
Application.ScreenUpdating = True
If Sheet17.Cells(width, 4).Value >= 55 Then MsgBox "You have screens on the order above the 55 inch maximum width! Please manually open the screen order and change these screens to mulled screens with adapters", vbOKOnly, "Over Width Screens on this order!"
Application.ScreenUpdating = False
Next width
End Sub