Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default Extracting data from alternate rows

I need some help with a macro to "fix" some data downloaded for me but
in a format my clients can't use. The first column is a label (county
names) in merged cells containing 2 rows, one column. I'd like to put
them into a single unmerged cell, still in Column A.
The second column (B) contains labels for the rows that I want to be
labels for the Columns, "Count" & "Col %", alternating every other row.

Col C contains first the data count, then the percentage of the state
total below it, then the next county count, then percentage, etc in
alternating rows. I'd like the count in column B next to the percentage
in Col C. Columns D and E have the same situation as column C, and I
want the percentages "pulled out" and put next to the counts. So it
looks like this:

Col A Col B Col C Col D Col E A (2
vert. merged "Count" xxx zzz bbb cells)
"Col %" yyy aaa ccc

and so forth.

What I want is:

Col A Col B Col C Col D Col E Col F Col G
"Count" "Col%" "Count" "Col %" "Total" "%"
A (in single xxx yyy zzz aaa bbb ccc
unmerged cell)

and so forth for the rest of the counties.

I hope this makes some sense. Can anyone help me with the code to move
the data into straight columns?
Thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default Extracting data from alternate rows

I would turn on the macro recorder and do the following:

1. Turn on R1C1 reference style at Tools/Options
2. Unmerge all cells
3. Insert new columns where you the percentages are to be copied
4. Assuming that column A is now blank in 2nd row of each pair, in the new
columns put this R1C1 formula:

=IF(RC1="","",R[+1]C[-1])

Copy it down through the last row of data.

5. Select the entire used range and Copy it, then Edit/Paste Special,
and select Values
6. Select Column A
7. Edit/Goto/Special and select Blanks
8. Delete the selected rows.
9. Switch back to A1 reference style.

Then you can modify the code to locate the bottom row with code and fill the
formulas down the correct number of rows.

On 8 Apr 2005 10:25:50 -0700, "davegb" wrote:

I need some help with a macro to "fix" some data downloaded for me but
in a format my clients can't use. The first column is a label (county
names) in merged cells containing 2 rows, one column. I'd like to put
them into a single unmerged cell, still in Column A.
The second column (B) contains labels for the rows that I want to be
labels for the Columns, "Count" & "Col %", alternating every other row.

Col C contains first the data count, then the percentage of the state
total below it, then the next county count, then percentage, etc in
alternating rows. I'd like the count in column B next to the percentage
in Col C. Columns D and E have the same situation as column C, and I
want the percentages "pulled out" and put next to the counts. So it
looks like this:

Col A Col B Col C Col D Col E A (2
vert. merged "Count" xxx zzz bbb cells)
"Col %" yyy aaa ccc

and so forth.

What I want is:

Col A Col B Col C Col D Col E Col F Col G
"Count" "Col%" "Count" "Col %" "Total" "%"
A (in single xxx yyy zzz aaa bbb ccc
unmerged cell)

and so forth for the rest of the counties.

I hope this makes some sense. Can anyone help me with the code to move
the data into straight columns?
Thanks in advance.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default Extracting data from alternate rows

Thanks, Myrna, worked great!

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
importing data into alternate rows oldLearner57 Excel Discussion (Misc queries) 3 April 22nd 08 05:23 PM
reformating data- how to delete alternate blank rows quickly datamanipulator Excel Discussion (Misc queries) 4 November 27th 07 04:41 PM
How do I delete blank rows (rows alternate data, blank, data, etc ncochrax Excel Discussion (Misc queries) 2 June 27th 07 04:40 AM
Extracting data from rows where one field is blank BillBurton57 Excel Discussion (Misc queries) 5 August 11th 06 04:57 PM
Ignoring Rows When Extracting Data From One Worksheet To Another Jim J. Excel Worksheet Functions 2 May 8th 06 04:55 PM


All times are GMT +1. The time now is 08:22 AM.

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"