sycodiz
New Member
- Joined
- Jun 15, 2008
- Messages
- 27
I have searched everywhere for this answer. I am sure it is out there but I feel like I am going in circles. So I came here to you awesome people for help and direction!
I do apologize that I am not very savvy in VBA but occasionally I do have to create some crude macros and then come to you great folks for advice.
I have a macro created that will grab data and move to another sheet and then save off. I even have some validations. Everything works great.
However, I am trying to do a validation on some cells. If the cell is false, I would like a msgbox to say "Row x has an error, do you wish to accept and continue?" if the answer is yes, the code moves on. If the answer is no, then I would like a response "Please fix row x" and then exit the sub.
The values are in f38:f64. They are a value of true or false.
I have wrote each line out but I am having issues with the exiting sub. It keeps returning the same second message no matter if I choose yes or no.
This is where I am at the code right now.
If Range("f38").Value = False Then
MsgBox "Row 38 has an error, do you whish to accept and continue?", vbYesNo + vbQuestion, "Error found"
If VbMsgBoxResult.vbYes Then MsgBox "Please fix row 38"
Else
Exit Sub
End If
I can have each line in the code if needed, I think there is a way to do a loop and return the line that finds the value of false.
Any help would be greatly appreciated.
I do apologize that I am not very savvy in VBA but occasionally I do have to create some crude macros and then come to you great folks for advice.
I have a macro created that will grab data and move to another sheet and then save off. I even have some validations. Everything works great.
However, I am trying to do a validation on some cells. If the cell is false, I would like a msgbox to say "Row x has an error, do you wish to accept and continue?" if the answer is yes, the code moves on. If the answer is no, then I would like a response "Please fix row x" and then exit the sub.
The values are in f38:f64. They are a value of true or false.
I have wrote each line out but I am having issues with the exiting sub. It keeps returning the same second message no matter if I choose yes or no.
This is where I am at the code right now.
If Range("f38").Value = False Then
MsgBox "Row 38 has an error, do you whish to accept and continue?", vbYesNo + vbQuestion, "Error found"
If VbMsgBoxResult.vbYes Then MsgBox "Please fix row 38"
Else
Exit Sub
End If
I can have each line in the code if needed, I think there is a way to do a loop and return the line that finds the value of false.
Any help would be greatly appreciated.