Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub ForEachLeft()
- Dim Threshold As Double
- Threshold = 1.15
- Dim RowIdx As Long
- Dim StartCol As String
- Dim EndCol As String
- 'Specify range here:
- StartCol = "Z"
- EndCol = "T"
- RowIdx = 7
- Dim StartColIdx As Long
- Dim EndColIdx As Long
- StartColIdx = Range(StartCol & 1).Column
- EndColIdx = Range(EndCol & 1).Column
- Dim i As Long
- Dim currVal As Double
- For i = StartColIdx To EndColIdx Step -1
- 'MsgBox "[" & RowIdx & "," & i & "] Val=" & Cells(RowIdx, i).Value()
- currVal = Cells(RowIdx, i).Value()
- If currVal <= Threshold Then
- MsgBox currVal & "is less or equal to threshold -> subtracting in increments"
- Else
- MsgBox currVal & "is greater than threshold -> skip this cell"
- End If
- Next i
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement