Dim ALastRow As Long Dim RowCount As Long Dim BlankCount As Long ALastRow = 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
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.