ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   moving data to one row (https://www.excelbanter.com/excel-discussion-misc-queries/194944-moving-data-one-row.html)

Stacie

moving data to one row
 
I have pasted data into an excel spreadsheet, but the data is on two
different lines ex:
A6530 COMPRESSION STOCKING BK18-30
A9900 2 PAIR $ 45.46
L3908 WHO, WRIST EXTENSION
A9900 1 EACH $ 11.81


I need all of the data on one line like this:
A6530 COMPRESSION STOCKING BK18-30 A9900 2 PAIR $ 45.46
L3908 WHO, WRIST EXTENSION A9900 1 EACH $ 11.81

Is there a way to do this in excel?
--
stacie

Don Guillett

moving data to one row
 
Try this

Sub allonerow()
mc = "a"
For i = Cells(Rows.Count, mc).End(xlUp).row To 1 Step -2
Cells(i - 1, mc) = Cells(i - 1, mc) & " " & Cells(i, mc)
Rows(i).Delete
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"stacie" wrote in message
...
I have pasted data into an excel spreadsheet, but the data is on two
different lines ex:
A6530 COMPRESSION STOCKING BK18-30
A9900 2 PAIR $ 45.46
L3908 WHO, WRIST EXTENSION
A9900 1 EACH $ 11.81


I need all of the data on one line like this:
A6530 COMPRESSION STOCKING BK18-30 A9900 2 PAIR $ 45.46
L3908 WHO, WRIST EXTENSION A9900 1 EACH $
11.81

Is there a way to do this in excel?
--
stacie



Stacie

moving data to one row
 
Don,
Can you break this down a little for me? Where do I put he information you
suggested?
--
stacie


"Don Guillett" wrote:

Try this

Sub allonerow()
mc = "a"
For i = Cells(Rows.Count, mc).End(xlUp).row To 1 Step -2
Cells(i - 1, mc) = Cells(i - 1, mc) & " " & Cells(i, mc)
Rows(i).Delete
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"stacie" wrote in message
...
I have pasted data into an excel spreadsheet, but the data is on two
different lines ex:
A6530 COMPRESSION STOCKING BK18-30
A9900 2 PAIR $ 45.46
L3908 WHO, WRIST EXTENSION
A9900 1 EACH $ 11.81


I need all of the data on one line like this:
A6530 COMPRESSION STOCKING BK18-30 A9900 2 PAIR $ 45.46
L3908 WHO, WRIST EXTENSION A9900 1 EACH $
11.81

Is there a way to do this in excel?
--
stacie




Jarek Kujawa[_2_]

moving data to one row
 
press ALT+F11, then click on Insert, click Module
copy Don's code and paste into the empty Module's window
then select your last (bottom) cell in the worksheet
come back to Module and press F5

Don Guillett

moving data to one row
 
If you're new to macros, you may want to read David McRitchie's intro
at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"stacie" wrote in message
...
Don,
Can you break this down a little for me? Where do I put he information
you
suggested?
--
stacie


"Don Guillett" wrote:

Try this

Sub allonerow()
mc = "a"
For i = Cells(Rows.Count, mc).End(xlUp).row To 1 Step -2
Cells(i - 1, mc) = Cells(i - 1, mc) & " " & Cells(i, mc)
Rows(i).Delete
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"stacie" wrote in message
...
I have pasted data into an excel spreadsheet, but the data is on two
different lines ex:
A6530 COMPRESSION STOCKING BK18-30
A9900 2 PAIR $ 45.46
L3908 WHO, WRIST EXTENSION
A9900 1 EACH $ 11.81


I need all of the data on one line like this:
A6530 COMPRESSION STOCKING BK18-30 A9900 2 PAIR $
45.46
L3908 WHO, WRIST EXTENSION A9900 1 EACH $
11.81

Is there a way to do this in excel?
--
stacie






All times are GMT +1. The time now is 03:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com