Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Inserting a blank row when data changes

Excel Experts:

I have a spreadsheet similar to the following

A B
1 4K3F
2 4K3F
3 4K3F
4 5B6L
5 5B6L
6 8E2B
7 8E2B

I would like my macro to go down column A, and each time the data changes
(i.e., row 4 and row 6) insert a blank row.

What code would do this?

Thanks
Alan

--
achidsey
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Inserting a blank row when data changes

try something like this working from the bottom up

sub insertatchange
for i=cells(rows.count,"a").end(xlup).row to 1 step -1
if cells(i-1,"a")<cells(i,"a") then rows(i).insert
next i
end sub
--
Don Guillett
SalesAid Software

"achidsey" (notmorespam) wrote in message
...
Excel Experts:

I have a spreadsheet similar to the following

A B
1 4K3F
2 4K3F
3 4K3F
4 5B6L
5 5B6L
6 8E2B
7 8E2B

I would like my macro to go down column A, and each time the data changes
(i.e., row 4 and row 6) insert a blank row.

What code would do this?

Thanks
Alan

--
achidsey



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting a blank row between rows of data Michael Styles Excel Worksheet Functions 8 January 30th 10 08:28 PM
Inserting numerous blank lines between specific rows of data Deb Excel Discussion (Misc queries) 5 December 22nd 09 05:01 PM
Inserting data into next blank cell down in next sheet Nick Wakeham Excel Worksheet Functions 2 July 24th 08 08:07 PM
Inserting blank rows for missing data in order to transpose [email protected] Excel Worksheet Functions 3 May 3rd 08 09:06 PM
inserting a blank row mrselkoil Excel Discussion (Misc queries) 1 January 24th 07 09:18 PM


All times are GMT +1. The time now is 01:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"