tourless
Board Regular
- Joined
- Feb 8, 2007
- Messages
- 144
- Office Version
- 365
- Platform
- Windows
Hi Folks.
I'm having a problem with the following task... With range H4 to H last row, if cell begins with "Net", then look at cell in same row in Column D and if D cell value is positive number, place "1009992" into cell in same row in Column C. If H cell does not start with "Net", move on to the next row. I have captured my last row and can search the range for cells beginning with "Net" but then I'm lost with offsets and testing the value in D. Here's what I've got so far and it's not working at all.
I'm having a problem with the following task... With range H4 to H last row, if cell begins with "Net", then look at cell in same row in Column D and if D cell value is positive number, place "1009992" into cell in same row in Column C. If H cell does not start with "Net", move on to the next row. I have captured my last row and can search the range for cells beginning with "Net" but then I'm lost with offsets and testing the value in D. Here's what I've got so far and it's not working at all.
VBA Code:
With Sheets("My Sheet")
For Each cell In .Range("H4:H" & lRow)
If UCase(Left(cell.Value, 3)) = "Net" Then
If ws.Cells(i, 4).Value > 0 Then
ws.Cells(i, 3).Value = "1009992"
End If
Next
End With