Hi guys
Hoping a genius can help me with a quick check before running through a macro...
My vba below works perfectly, however can someone please help add some validation before running my macro that does the following check:
Cell C9 must contain either the text "RP2000" or "RP5000"
Cell C11 must contain a value larger than 0
C13 must contain a value larger than 0
C15 must contain a value larger than 0
If all the above criteria is NOT met then when clicking the macro button a Msgbox is instead presented with a warning telling the user to enter the information required for the Cell's that have not been entered with an OK button which then ends the macro without running further?
Otherwise, if all the above criteria has been met then the macro will proceed to running.
Please see my current vba below:
Thank you so much in advance!
Hoping a genius can help me with a quick check before running through a macro...
My vba below works perfectly, however can someone please help add some validation before running my macro that does the following check:
Cell C9 must contain either the text "RP2000" or "RP5000"
Cell C11 must contain a value larger than 0
C13 must contain a value larger than 0
C15 must contain a value larger than 0
If all the above criteria is NOT met then when clicking the macro button a Msgbox is instead presented with a warning telling the user to enter the information required for the Cell's that have not been entered with an OK button which then ends the macro without running further?
Otherwise, if all the above criteria has been met then the macro will proceed to running.
Please see my current vba below:
Code:
Sub colour()Range("F9:I14").Interior.Color = RGB(242, 242, 242)
Range("F9:I14").Font.Color = RGB(0, 0, 0)
Range("F16:I16").Interior.Color = RGB(149, 0, 46)
Range("F16:I16").Font.Color = RGB(255, 255, 255)
Range("F19:I43").Interior.Color = RGB(242, 242, 242)
Range("F19:I43").Font.Color = RGB(0, 0, 0)
Range("F4").Select
ActiveCell.FormulaR1C1 = "Please find approximate BOM below:"
Range("A1").Select
Dim xRg As Range
Application.ScreenUpdating = False
For Each xRg In Range("I22:I45")
If xRg.Value = "0" Then
xRg.EntireRow.Hidden = True
Else
xRg.EntireRow.Hidden = False
End If
Next xRg
Application.ScreenUpdating = True
MsgBox "The BOM has been generated!", vbInformation
End Sub
Thank you so much in advance!