Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Search Columns For Change, Insert Blank Rows, and Sum Different Co

Hi, I have data that I export from Proclarity to Excel monthly. After I do
this, I'd like to run a macro that compares data in column A & B to data in A
& B for the next row. If data in EITHER A or B are different, I'd like to
Insert 2 new rows and insert the sum for that group on the first newly
inserted row for columns D,E,F, and G.

Both Column A & B contain numbers AND text.

Here is an example of the data separated by '/':

Column A/Column B/Column C/Column D......etc

8999 Path & Lab/ 1234XN425 / 2224 Text Name / $1225.36.....
8999 Path & Lab/ 1234XN425 / 2224 Text Name / $9365.91.....
( Column A different below: Insert 2 new rows and sum columns D-G on first
row.)

8901 Mental Health/ 1234XN425 / 2224 Text Name/ $1234.00....

So, column A OR B data different, insert 2 new rows and sum D-G on 1st new
row.

Thanks



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Search Columns For Change, Insert Blank Rows, and Sum Different Co

Suppose data looks like this:
8999 Path & Lab/ 1234XN425 / 2224 Text Name / $100 / $100 / $100
8999 Path & Lab/ 1234XN425 / 2224 Text Name / $200 / $200 / $200

You say "Column A different below: Insert 2 new rows and sum columns D-
G on first row.)" What is the sum, $900?

Merjet


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Search Columns For Change, Insert Blank Rows, and Sum Differen

No, sorry. I need to sum each of the 4 columns D,E,F,G individually. I see
that I worded it poorly.

"merjet" wrote:

Suppose data looks like this:
8999 Path & Lab/ 1234XN425 / 2224 Text Name / $100 / $100 / $100
8999 Path & Lab/ 1234XN425 / 2224 Text Name / $200 / $200 / $200

You say "Column A different below: Insert 2 new rows and sum columns D-
G on first row.)" What is the sum, $900?

Merjet



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Search Columns For Change, Insert Blank Rows, and Sum Different Co

You may find that your life in excel becomes easier if you use its built in
functions.

Add headers to your data
Data|subtotals
(twice)
Once for column B, then once more for column A.

If you don't like the double subtotals, you could concatenate the data in
columns A and B with something like:

Insert a new column A (shifting everything to the right one column)

Add headers to A1
Put this in A2
=b2&"---"&c2
and drag down.

Then do the data|subtotals on column A.

It won't be exactly what you specified, but it's simple and it's built in.

Bagman wrote:

Hi, I have data that I export from Proclarity to Excel monthly. After I do
this, I'd like to run a macro that compares data in column A & B to data in A
& B for the next row. If data in EITHER A or B are different, I'd like to
Insert 2 new rows and insert the sum for that group on the first newly
inserted row for columns D,E,F, and G.

Both Column A & B contain numbers AND text.

Here is an example of the data separated by '/':

Column A/Column B/Column C/Column D......etc

8999 Path & Lab/ 1234XN425 / 2224 Text Name / $1225.36.....
8999 Path & Lab/ 1234XN425 / 2224 Text Name / $9365.91.....
( Column A different below: Insert 2 new rows and sum columns D-G on first
row.)

8901 Mental Health/ 1234XN425 / 2224 Text Name/ $1234.00....

So, column A OR B data different, insert 2 new rows and sum D-G on 1st new
row.

Thanks


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Search Columns For Change, Insert Blank Rows, and Sum Differen

Let's see if I get it. Suppose data in rows 1-3 looks like this:
8999 Path & Lab/ 1234XN425 / 2224 Text Name / $100 / $100 / $100 /
$100
8999 Path & Lab/ 1234XN425 / 2224 Text Name / $200 / $200 / $200 /
$200
8901 Mental Health/ 1234XN425 / 2224 Text Name/ $1234.00....

You want to insert empty rows at 3 & 4, pushing the 3rd line of data
to
row 5. Where do you want $400 and $800 ? Cells A3 and B3?

Merjet




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Search Columns For Change, Insert Blank Rows, and Sum Differen

I want to insert the empty rows where you say, but then sum the columns
D,E,F,G. So, $300 would appear in the newly inserted row in cells
D3,E3,F3,G3. Then Loop and do the same all the way down.

"merjet" wrote:

Let's see if I get it. Suppose data in rows 1-3 looks like this:
8999 Path & Lab/ 1234XN425 / 2224 Text Name / $100 / $100 / $100 /
$100
8999 Path & Lab/ 1234XN425 / 2224 Text Name / $200 / $200 / $200 /
$200
8901 Mental Health/ 1234XN425 / 2224 Text Name/ $1234.00....

You want to insert empty rows at 3 & 4, pushing the 3rd line of data
to
row 5. Where do you want $400 and $800 ? Cells A3 and B3?

Merjet



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
Text to Rows and then Insert Blank Rows [email protected] Excel Discussion (Misc queries) 1 December 20th 08 04:23 PM
How do i insert blank rows between data that is thousands of rows paul.eatwell Excel Discussion (Misc queries) 5 April 14th 08 10:49 PM
How do I insert blank rows between rows in completed worksheet? bblue1978 Excel Discussion (Misc queries) 1 October 26th 06 07:02 PM
Insert a blank Column Every 9 Columns Nigel Bennett Excel Programming 4 March 15th 05 04:53 PM
Insert Blank Column every 9 Columns Nigel Bennett Excel Programming 2 March 15th 05 04:24 AM


All times are GMT +1. The time now is 07:29 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"