Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Output array to Excel blank rows separating groups
I've got an array which I'd like to group while writing it to Excel b inserting a blank row above (and below) any groups of repeating value in Col "A". Determining the locations for the bottom blank row i easy, it's the top row that I'm having a problem with. Any tips? Here's my test code to replicate what I want to do: Code ------------------- Function tester() Dim IDCount Dim IDHold Dim i IDCount = 0 IDHold = "" Dim ID Dim IDS As Variant ID = "" IDS = Array("A", "A", "B", "B", "C", "D", "E", "F", "F", "G") For i = 1 To 10 ID = IDS(i) 'IDCount = IDCount + 1 If ID < IDHold Then If IDCount 1 Then 'MsgBox "EXTRA ROW INSERTED" Debug.Print "" IDCount = 0 End If End If Debug.Print "ID: " & ID & " " & "IDHOLD: " & IDHold & " " & "IDCOUNT: " & IDCount IDHold = ID IDCount = IDCount + 1 Next i End Function ------------------- Thanks, Rand -- ghh3r ----------------------------------------------------------------------- ghh3rd's Profile: http://www.excelforum.com/member.php...fo&userid=3204 View this thread: http://www.excelforum.com/showthread.php?threadid=51797 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to create groups of several rows in sheet (excel)? | New Users to Excel | |||
Adding blank rows between groups of similar names | Excel Worksheet Functions | |||
Identifying and separating groups of data. | Excel Programming | |||
In Excel my autofilter? is omitting some data rows from output | Excel Programming | |||
Help with 1 x 2 array output | Excel Programming |