Re: vb code for macro to not execute when blank cell encountered.
what is the difference between this question and your previous one?
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Re: vb code for macro to not execute when blank cell encountered.
the difference is after i modified the code i found that i had to enter a value in all rows in the h column until 200. what i want is in that range H20 to H200 even if i enter one value in either one of the rows then that is acceptable.
have attached a mock file with code for your reference.
thanks again.
Re: vb code for macro to not execute when blank cell encountered.
vb Code:
dim notallempty as boolean, c as range
for each c in range("o3:0333")
if not isempty(c) then notallempty = true: exit for
next
if not isempty(range("c9")) and not isempty(range("c10") and notallempty then
else
exit sub
end if
change ranges to suit, i didn't test, but looks right
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Re: vb code for macro to not execute when blank cell encountered.
needs extra closing bracket after c10"
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete