Hi
I would like to ask that in the given code, in ranges between C3 to C178
I would create Data Validation from C3 to C16
Then again it will start from C21 end to C34
And this carry on to C178
Note taht the below code starts from C3 and again it starts from C21 by adding Step Statement which will not fullfill the above request.
Sub NewLoopDV()
Dim x As Integer
For x = 3 To 178 Step 18
With Range("C" & x & "").Validation
.Delete
.Add Type:=xlValidateCustom, AlertStyle:=xlValidAlertStop, Formula1:="=C" & x & "<=B" & x & ""
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = "Invalid Quantity"
.InputMessage = ""
.ErrorMessage = "It Must be enter less than or equal to Quantity Delivered"
.ShowInput = True
.ShowError = True
End With
Next x
End Sub
