Darren Smith
Well-known Member
- Joined
- Nov 23, 2020
- Messages
- 631
- Office Version
- 2019
- Platform
- Windows
I am trying to say if cell A10 is under 3200 then fill in 6 to selected cells if not then 8
For some reason, nothing happens?
If it helps I could send the workbook?
For some reason, nothing happens?
If it helps I could send the workbook?
VBA Code:
Private Sub HingeQty()
Dim ws As Worksheet
Dim iRow As Integer
Set ws = ThisWorkbook.Worksheets("Job Card Master")
With ws
If .Range("A10") <= 3200 Then
iRow = .Range("E13:F" & .UsedRange.Rows.Count).Find("SIDEBOARD", LookIn:=xlValues, lookat:=xlWhole).Row
iRow = iRow + 4
.Cells(iRow, 8) = 6
.Cells(iRow + 1, 8) = 6
Else
iRow = .Range("E13:F" & .UsedRange.Rows.Count).Find("SIDEBOARD", LookIn:=xlValues, lookat:=xlWhole).Row
iRow = iRow + 4
.Cells(iRow, 8) = 8
.Cells(iRow + 1, 8) = 8
End If
End With
End Sub