Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Seperate row to Column.

Hi,
I got the address file. The all in one Colume (A)
with alot of rows. Each address file seperate by the empty
row. How can I got the each address file from each row to
columns. Examples of two address record;

Column A
========

AAA xxx
123 st
sss,fff
xxxx


BBB ZZZ
345 sr
ggg, hhhh
jjdld

TO

Column A Column B Column C Column D
===============================================
AAA xxx 123 st sss, fff xxxx
BBB ZZZ 345 sr ggg, hhh jjdld

How can i write a macro for this?

Any help would be very appreciate.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Seperate row to Column.

Try this

With the data start in row 1
it will transpose the data to column C:F

Sub test()
Dim a As Long
Dim b As Long
b = 0
For a = 1 To Range("A" & Columns.Count).End(xlUp).Row Step 5
b = b + 1
Range("A" & a).Resize(4, 1).Copy
Range("C" & b).PasteSpecial xlPasteValues, , False, True
Next
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"sigh" wrote in message ...
Hi,
I got the address file. The all in one Colume (A)
with alot of rows. Each address file seperate by the empty
row. How can I got the each address file from each row to
columns. Examples of two address record;

Column A
========

AAA xxx
123 st
sss,fff
xxxx


BBB ZZZ
345 sr
ggg, hhhh
jjdld

TO

Column A Column B Column C Column D
===============================================
AAA xxx 123 st sss, fff xxxx
BBB ZZZ 345 sr ggg, hhh jjdld

How can i write a macro for this?

Any help would be very appreciate.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Seperate row to Column.


Thanks for help. I miss some information here. some of the
address file has different rows. Some has 4 row and some
has 5 or 6 rows. How can I change your code to solved this
problems.

-----Original Message-----
Try this

With the data start in row 1
it will transpose the data to column C:F

Sub test()
Dim a As Long
Dim b As Long
b = 0
For a = 1 To Range("A" & Columns.Count).End(xlUp).Row

Step 5
b = b + 1
Range("A" & a).Resize(4, 1).Copy
Range("C" & b).PasteSpecial xlPasteValues, , False, True
Next
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"sigh" wrote in message

...
Hi,
I got the address file. The all in one Colume (A)
with alot of rows. Each address file seperate by the

empty
row. How can I got the each address file from each row

to
columns. Examples of two address record;

Column A
========

AAA xxx
123 st
sss,fff
xxxx


BBB ZZZ
345 sr
ggg, hhhh
jjdld

TO

Column A Column B Column C Column D
===============================================
AAA xxx 123 st sss, fff xxxx
BBB ZZZ 345 sr ggg, hhh jjdld

How can i write a macro for this?

Any help would be very appreciate.



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Seperate row to Column.

Try something like this Sigh

Sub test()
Dim Copyrw As Long
Dim lrw As Long
Dim frw As Long
frw = 1
For frw = 1 To Range("A" & Columns.Count).End(xlUp).Row
Copyrw = Copyrw + 1
lrw = Range("A" & frw).End(xlDown).Row
Range("A" & frw).Resize(lrw - frw + 1, 1).Copy
Range("C" & Copyrw).PasteSpecial xlPasteValues, , False, True
frw = lrw + 1
Next
Application.CutCopyMode = False
End Sub

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Sigh" wrote in message ...

Thanks for help. I miss some information here. some of the
address file has different rows. Some has 4 row and some
has 5 or 6 rows. How can I change your code to solved this
problems.

-----Original Message-----
Try this

With the data start in row 1
it will transpose the data to column C:F

Sub test()
Dim a As Long
Dim b As Long
b = 0
For a = 1 To Range("A" & Columns.Count).End(xlUp).Row

Step 5
b = b + 1
Range("A" & a).Resize(4, 1).Copy
Range("C" & b).PasteSpecial xlPasteValues, , False, True
Next
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"sigh" wrote in message

...
Hi,
I got the address file. The all in one Colume (A)
with alot of rows. Each address file seperate by the

empty
row. How can I got the each address file from each row

to
columns. Examples of two address record;

Column A
========

AAA xxx
123 st
sss,fff
xxxx


BBB ZZZ
345 sr
ggg, hhhh
jjdld

TO

Column A Column B Column C Column D
===============================================
AAA xxx 123 st sss, fff xxxx
BBB ZZZ 345 sr ggg, hhh jjdld

How can i write a macro for this?

Any help would be very appreciate.



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Seperate row to Column.


Yes, it works. But it only convert up to row 256 and then
stop. The file in the column A has the text up to 400 rows.

-----Original Message-----
Try something like this Sigh

Sub test()
Dim Copyrw As Long
Dim lrw As Long
Dim frw As Long
frw = 1
For frw = 1 To Range("A" & Columns.Count).End(xlUp).Row
Copyrw = Copyrw + 1
lrw = Range("A" & frw).End(xlDown).Row
Range("A" & frw).Resize(lrw - frw + 1, 1).Copy
Range("C" & Copyrw).PasteSpecial xlPasteValues, , False,

True
frw = lrw + 1
Next
Application.CutCopyMode = False
End Sub

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Sigh" wrote in message

...

Thanks for help. I miss some information here. some of

the
address file has different rows. Some has 4 row and some
has 5 or 6 rows. How can I change your code to solved

this
problems.

-----Original Message-----
Try this

With the data start in row 1
it will transpose the data to column C:F

Sub test()
Dim a As Long
Dim b As Long
b = 0
For a = 1 To Range("A" & Columns.Count).End(xlUp).Row

Step 5
b = b + 1
Range("A" & a).Resize(4, 1).Copy
Range("C" & b).PasteSpecial xlPasteValues, , False,

True
Next
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"sigh" wrote in message

...
Hi,
I got the address file. The all in one Colume

(A)
with alot of rows. Each address file seperate by the

empty
row. How can I got the each address file from each

row
to
columns. Examples of two address record;

Column A
========

AAA xxx
123 st
sss,fff
xxxx


BBB ZZZ
345 sr
ggg, hhhh
jjdld

TO

Column A Column B Column C Column D
===============================================
AAA xxx 123 st sss, fff xxxx
BBB ZZZ 345 sr ggg, hhh jjdld

How can i write a macro for this?

Any help would be very appreciate.


.



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Seperate row to Column.

Ahhh

My mistake

For frw = 1 To Range("A" & Columns.Count).End(xlUp).Row

must be

For frw = 1 To Range("A" & Rows.Count).End(xlUp).Row



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Sigh" wrote in message ...

Yes, it works. But it only convert up to row 256 and then
stop. The file in the column A has the text up to 400 rows.

-----Original Message-----
Try something like this Sigh

Sub test()
Dim Copyrw As Long
Dim lrw As Long
Dim frw As Long
frw = 1
For frw = 1 To Range("A" & Columns.Count).End(xlUp).Row
Copyrw = Copyrw + 1
lrw = Range("A" & frw).End(xlDown).Row
Range("A" & frw).Resize(lrw - frw + 1, 1).Copy
Range("C" & Copyrw).PasteSpecial xlPasteValues, , False,

True
frw = lrw + 1
Next
Application.CutCopyMode = False
End Sub

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Sigh" wrote in message

...

Thanks for help. I miss some information here. some of

the
address file has different rows. Some has 4 row and some
has 5 or 6 rows. How can I change your code to solved

this
problems.

-----Original Message-----
Try this

With the data start in row 1
it will transpose the data to column C:F

Sub test()
Dim a As Long
Dim b As Long
b = 0
For a = 1 To Range("A" & Columns.Count).End(xlUp).Row
Step 5
b = b + 1
Range("A" & a).Resize(4, 1).Copy
Range("C" & b).PasteSpecial xlPasteValues, , False,

True
Next
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"sigh" wrote in message
...
Hi,
I got the address file. The all in one Colume

(A)
with alot of rows. Each address file seperate by the
empty
row. How can I got the each address file from each

row
to
columns. Examples of two address record;

Column A
========

AAA xxx
123 st
sss,fff
xxxx


BBB ZZZ
345 sr
ggg, hhhh
jjdld

TO

Column A Column B Column C Column D
===============================================
AAA xxx 123 st sss, fff xxxx
BBB ZZZ 345 sr ggg, hhh jjdld

How can i write a macro for this?

Any help would be very appreciate.


.



.



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
Need to seperate every 6th row out of a column? DLN Excel Discussion (Misc queries) 1 July 21st 08 11:54 PM
seperate first 2 lines of column in seperate columns in same row Glynnhamer Excel Discussion (Misc queries) 2 October 9th 06 04:23 AM
Seperate Data in one column into two columns? Dan B Excel Worksheet Functions 4 June 30th 06 09:20 PM
Excel - returning column headers in a seperate column ExcelConfused Excel Discussion (Misc queries) 1 March 28th 06 02:49 PM
how do i seperate data from one column into two seperate ones in . Nikki Excel Discussion (Misc queries) 2 March 30th 05 08:31 PM


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