PresidentEvil
New Member
- Joined
- Jan 2, 2021
- Messages
- 34
- Office Version
- 2021
- 2016
- Platform
- Windows
Hi,
Code mentioned below has an issue to it. I have two columns ( A & B )
A contains unique IDs
B contains values
I'm using a macro with a loop to update the values in B column for respective IDs. However, the condition to stop the loop is not working. The null value condition is working without a problem but the condition after 'OR' operator is not working. Purpose is to stop the loop when there is a blank in column A or has the text "Access Denied" in column B.
Any hep is highly appreciated.
Code mentioned below has an issue to it. I have two columns ( A & B )
A contains unique IDs
B contains values
I'm using a macro with a loop to update the values in B column for respective IDs. However, the condition to stop the loop is not working. The null value condition is working without a problem but the condition after 'OR' operator is not working. Purpose is to stop the loop when there is a blank in column A or has the text "Access Denied" in column B.
Any hep is highly appreciated.
VBA Code:
Set indexSheet = ActiveSheet
Sheets("Update").Select
irow = 2
A1 = 2
Do While indexSheet.Cells(irow, 1).Value <> vbNullString Or indexSheet.Cells(irow, "B").Value <> "Not Authorized"
' codes to run in the loop is here (I use SENDKEYS)
irow = irow + 1
A1 = A1 + 1
Loop
On Error GoTo 0
[/CODE