I Have cross posted this on the Mr. Excel Forum. It is unanswered: Problem with data Grouping On this thread I have attempted to manipulate the below code unsuccessfully. I have data that I want to group based on values in column C. My data set has spaces (blanks "") in it in column C. I would like to group all data after "" values (blank) based on this occurring in column C (3). I have the following code which i adapted in the past however, I was unsure of the actually meaning of the code. And at this point I am more confused than ever. After trying to manipulate it for hours and having been unsuccessful I decided to seek help. The code I used in the past did the same thing based on "" values in column B. I have changed different things in the code and have realized that I was lucky to get it to work the first time. The code I have is as follows:
Can someone offer code to fix my current dilemma? and explain what exactly the code does so that I can understand it and further my knowledge base. Thank you for any advice or solutions you can offer. If a solution is reached here I will also update the Mr. Excel Board Thread so that people's time is not wasted.Code:Sub GroupData() Dim i As Integer, LastRow As Integer LastRow = Cells(Rows.Count, 2).End(xlUp).Row For i = 3 To LastRow If Not Left(Cells(i, 2), 3) = "" Then Cells(i, 1).EntireRow.Group End If Next i End Sub




Reply With Quote
Bookmarks