moving columns to rows....

jbyrne

Board Regular
Joined
Feb 22, 2002
Messages
178
IN SOME CASES I HAVE THE SAME NAME WITH MULTIPLE ADDRESSES. FOR EXAMPLE

COLUMN A B C D E
JOHN SMITH 123 MAIN ST ANYTOWN NJ 07622
JOHN SMITH 421 SOUTH DR ANYTOWN NJ 07624
JOHN SMITH 923 9TH AVE ANYTOWN NJ 07221
MARY DOE 123 5TH ST ANYTOWN OH 23473
MARY DOE 523 2ND ST ANYTOWN PA 34737

WHAT I WANT TO DO IS HAVE THE ADDRESSES GOING ACCROSS INSTEAD OF DOWNWARD IN THE COLUMN. EXAMPLE ABOVE (IF SAME NAME MOVE B2 TO F1)

ANY IDEAS?
 
Hey,

I got your email on " Combine data" but no attachment. Can you please resend?

Thanks

Frank
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hey Jay,

Just wanted to let you know that I used the macro today for the first time at work and it worked great! Thanks!

I noticed that on sheet2 there is a 1 space in the beginning of each columns B D & E as well as I K & L

I manually took out the space in each column by text to columns but I was wondering if there could be a correction in the macro you sent me?

Thanks
Jim
 
Upvote 0
On 2002-05-02 12:04, jbyrne wrote:
Hey Jay,

Just wanted to let you know that I used the macro today for the first time at work and it worked great! Thanks!

I noticed that on sheet2 there is a 1 space in the beginning of each columns B D & E as well as I K & L

I manually took out the space in each column by text to columns but I was wondering if there could be a correction in the macro you sent me?

Thanks
Jim

Hey, no fair! :) Your sample workbook only had two columns.

I am guessing that your original data has the problem. If so, change the code to look like this

With ActiveSheet
.UsedRange

'''add this to the routine here
For Each cell In ActiveSheet.UsedRange
If Not cell.HasFormula Then cell = Trim(cell)
Next cell
''''''''''''''

lastrow = .Cells.SpecialCells(xlCellTypeLastCell).Row

Also include the following at the top, with the rest of the variable declarations.

Dim cell as Range

You should be OK. Let me know if this corrects the problem.

Bye,
Jay
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top