Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default arrange cell order


hi,
i have some data as follows:

A B C
1 abc xyz 15 (as a group of data)
2 hij 20
3 qwe wer 17

i want a result
A B
1 abc 15
2 xyz
3 -space-
4 hij 20
5 -space-
6 qwe 17
7 wer

is there any ideas how to write marco to solve it?
TIA
norik

--
norik
-----------------------------------------------------------------------
norika's Profile: http://www.excelforum.com/member.php...nfo&userid=487
View this thread: http://www.excelforum.com/showthread.php?threadid=49633

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default arrange cell order

Try this......

Sub Shuffler()
Dim xlr As Long, xr As Long, xB

xlr = Cells(Rows.Count, 1).End(xlUp).Row

For xr = xlr To 1 Step -1
xB = Cells(xr, 2)
Cells(xr, 2) = Cells(xr, 3)
Cells(xr, 3) = ""
Rows(xr + 1).EntireRow.Insert shift:=xlDown
Cells(xr + 1, 1) = xB
If xr 1 Then Rows(xr).EntireRow.Insert shift:=xlDown
Next

End Sub

--
Cheers
Nigel



"norika" wrote in
message ...

hi,
i have some data as follows:

A B C
1 abc xyz 15 (as a group of data)
2 hij 20
3 qwe wer 17

i want a result
A B
1 abc 15
2 xyz
3 -space-
4 hij 20
5 -space-
6 qwe 17
7 wer

is there any ideas how to write marco to solve it?
TIA
norika


--
norika
------------------------------------------------------------------------
norika's Profile:

http://www.excelforum.com/member.php...fo&userid=4878
View this thread: http://www.excelforum.com/showthread...hreadid=496333



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default arrange cell order


nigel,
thank you for your prompt reply.

after running your marco, the result is as below
A B
1 abc 15
2 xyz
3 space
4 hij 20
5 space ***
6 space ***
7 qwe 17
8 wer

is there any method to delete or erase line 6?

also, i have a lot ot sets of similar data. for example, set 1 is a
a1, the second is at a21, the third... (before running marco). if usin
insert or delete function, it may affect the absolute cell reference. i
there any ideas to 'move' upward rather insert or delete?

TIA

norik

--
norik
-----------------------------------------------------------------------
norika's Profile: http://www.excelforum.com/member.php...nfo&userid=487
View this thread: http://www.excelforum.com/showthread.php?threadid=49633

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
arrange data series order T-bone Charts and Charting in Excel 1 September 18th 08 01:08 PM
arrange sheets in alphatical order Ashwini New Users to Excel 1 September 21st 06 12:28 PM
How do I arrange sheets in alphabetical order? Supreme Grace Excel Discussion (Misc queries) 2 March 16th 05 05:02 PM
How do I arrange sheets in alphabetical order? gracebakky Excel Discussion (Misc queries) 2 March 16th 05 10:39 AM
how do i arrange column A (last name) in alphabetical order? t. hershy Excel Discussion (Misc queries) 2 November 28th 04 10:23 PM


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