Hi there,
I was wondering if anyone can help me out here...my collegue stopped by and asked if there's a way to count the # of blanks after a populated row, jump out of the loop, do another subroutine, then jump back in to the loop again...
So what he would like to do is (in the screenshot example):
See 09-B0640, count the 1 blank, exit out of the loop, based on the # of blanks (this case 1), go throught the Case function...after that's processed, go on to 09-P0650, count the blanks, exit out to the Case function, etc...etc...
I've also posted his code...I tried editing it, and I think there's got to be a Do While loop there or something...but I didn't want butcher his code and all the time he spent on it...lol.
If you can help us out, that would be awesome!!!
Thanks,
Classic
Dim ALastRow As LongDim RowCount As LongDim BlankCount As LongALastRow = Range("A" & Rows.Count).End(xlUp).Row + 1 For RowCount = 11 To ALastRow If Range("A" & RowCount) <> "" Then 'If cell is not blank BlankCount = 1 Range("C" & RowCount) = BlankCount BlankCount = 1 Else 'If cell is blank BlankCount = BlankCount + 1 Range("C" & RowCount - BlankCount + 1) = BlankCount End If Debug.Print BlankCount If BlankCount - 1 < 1 Then MsgBox "The Do Until loop made is complete." End If Exit For Next 'RowCount Select Case BlankCount Case 1 generateHTML1 Case 2 generateHTML2 Case 3 generateHTML3 Case 4 generateHTML4 Case 5 generateHTML5 Case 6 generateHTML6 End Select
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
Hey all,
Sorry for the non-response, I was out of the offiice the latter part of the week, and it was a holiday yesterday...
Thanks for your input, I've relayed the code to my co-worker, so hopefully, I'll get some feedback later today!!!
Much appreciated,
Classic
Your help has saved me hundreds of hours of internet surfing.
fblack61
Classic1
ASKER
Hi StephenJR,
Sorry for the delay, I gave my co-worker 2 weeks or so to give me some feedback, and he hasn't gotten back to me...but looking @ the code itself, it looks like it does the trick...