Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
MB MB is offline
external usenet poster
 
Posts: 53
Default Macro for moving data

I have data as follows (1 thru 11 are the rows; A and B are columns)

A B
1 ADM-1
2 blank row
3 SD1
4 blank row
5 ADM-2
6 blank row
7 SD2
8 blank row
9 ADM-3
10 blank row
11 SD3
and so on... How do I move the data so the SD#'s are next to the ADM# above
it, to be:

A B

1 ADM_1 SD1
2 ADM_2 SD2
3 ADM_3 SD3

I am using 2003.

Thank you!


--

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Macro for moving data

A macro is not needed. If your data is in column A, then in B1 enter:
=INDIRECT("A" & ROW()*4-3) and copy down

and in C1 enter:
=INDIRECT("A" & ROW()*4-1) and copy down
--
Gary''s Student - gsnu200772


"MB" wrote:

I have data as follows (1 thru 11 are the rows; A and B are columns)

A B
1 ADM-1
2 blank row
3 SD1
4 blank row
5 ADM-2
6 blank row
7 SD2
8 blank row
9 ADM-3
10 blank row
11 SD3
and so on... How do I move the data so the SD#'s are next to the ADM# above
it, to be:

A B

1 ADM_1 SD1
2 ADM_2 SD2
3 ADM_3 SD3

I am using 2003.

Thank you!


--

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Macro for moving data

You don't need a macro.

Select column A and F5SpecialBlanksOK

EditDeleteShift Up or delete entire rows.

In B1 enter =OFFSET($A$1,1*ROW()-1,0)

In C1 enter =OFFSET($A$1,2*ROW()-1,0)

Copy both down as far as half of "and so on".

In your example you would copy to row 3

If you had 12 cells with data you would copy down to row 6


Gord Dibben MS Excel MVP

On Fri, 7 Mar 2008 13:47:04 -0800, MB wrote:

I have data as follows (1 thru 11 are the rows; A and B are columns)

A B
1 ADM-1
2 blank row
3 SD1
4 blank row
5 ADM-2
6 blank row
7 SD2
8 blank row
9 ADM-3
10 blank row
11 SD3
and so on... How do I move the data so the SD#'s are next to the ADM# above
it, to be:

A B

1 ADM_1 SD1
2 ADM_2 SD2
3 ADM_3 SD3

I am using 2003.

Thank you!


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
Moving macro from one PC to another ChuckW Excel Discussion (Misc queries) 1 May 8th 07 02:45 PM
Moving a macro to other PCs ChuckW Excel Discussion (Misc queries) 7 February 13th 07 08:18 PM
Moving data from one worksheet to another via a Macro! [email protected] Links and Linking in Excel 0 February 6th 07 05:09 PM
Moving up / down in a macro Michel Khennafi Excel Worksheet Functions 1 April 28th 06 04:57 AM
Moving down one row in a macro Cathy S. New Users to Excel 3 January 4th 05 09:02 PM


All times are GMT +1. The time now is 02:39 AM.

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

About Us

"It's about Microsoft Excel"