Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with inserting a blank line on condition
Hi,
I've been programming in other languages but am very new to VB and still getting used to its syntax style - so I'm stuck with the simplest of problems. What I have is an excel spreadsheet (obviously). In column A there are text strings (names) that have been sorted into groups. So basically groups of names down the column. All I want to do is add a complete blank row after each name group - the number of names in each group is not consistent. eg Peter Peter Peter Paul Paul Mary Mary Mary Mary Can someone provide some help here? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with inserting a blank line on condition
Sub separategroups()
Dim lastrow as long, i as long lastrow = cells(rows.count,1).end(xlup).row for i = lastrow to 2 step -1 if cells(i,1).value < cells(i -1,1).value then rows(i).Insert end if Next End Sub -- Regards, Tom Ogilvy "microsatellite" wrote in message .com... Hi, I've been programming in other languages but am very new to VB and still getting used to its syntax style - so I'm stuck with the simplest of problems. What I have is an excel spreadsheet (obviously). In column A there are text strings (names) that have been sorted into groups. So basically groups of names down the column. All I want to do is add a complete blank row after each name group - the number of names in each group is not consistent. eg Peter Peter Peter Paul Paul Mary Mary Mary Mary Can someone provide some help here? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
If condition for Blank Cell | Excel Worksheet Functions | |||
inserting a row based on a condition. | Excel Worksheet Functions | |||
insert a line on condition | Excel Discussion (Misc queries) | |||
How do you add a blank line automatically after the Subtotal line | Excel Worksheet Functions | |||
copy line with 2 condition.... | Excel Programming |