ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Modifying data (https://www.excelbanter.com/excel-discussion-misc-queries/51556-modifying-data.html)

Extreem

Modifying data
 
Hello,

I have a simple spreadsheet with 2000 vendors names in the first column A
and address ect data in columns B - K. How can I get the data to reformat to
have column A list the vendor name in Cell A1 and all the other info be
presnet in B1-10 and then continue for all 2000 vendor names. I've torn my
hair out over this....I'm sure it's simple but I haven't had any luck at
all... Any thoughts appreciated.

Thank You,

Extreem

Rowan Drummond

Modifying data
 
Are you trying to make mailing labels? If so you are much better off
keeping your data in its current format and using it as a data source in
a MS Word mail merge.

If you really want to change the data this macro might help. SAVE before
trying this:

Sub MoveData()
Dim i As Long
Dim j As Integer
On Error GoTo ErrorHandler
Application.ScreenUpdating = False
For i = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
For j = 1 To 10
Cells(i + j, 1).EntireRow.Insert
Cells(i + j, 1).Value = Cells(i, j + 1).Value
Next j
Range(Cells(i, 2), Cells(i, 11)).ClearContents
Next i
ErrorHandler:
Application.ScreenUpdating = True
End Sub

Hope this helps
Rowan

Extreem wrote:
Hello,

I have a simple spreadsheet with 2000 vendors names in the first column A
and address ect data in columns B - K. How can I get the data to reformat to
have column A list the vendor name in Cell A1 and all the other info be
presnet in B1-10 and then continue for all 2000 vendor names. I've torn my
hair out over this....I'm sure it's simple but I haven't had any luck at
all... Any thoughts appreciated.

Thank You,

Extreem


Extreem

Modifying data
 
Thank You ! The code worked exactly as I had hoped.....

Extreem

"Rowan Drummond" wrote:

Are you trying to make mailing labels? If so you are much better off
keeping your data in its current format and using it as a data source in
a MS Word mail merge.

If you really want to change the data this macro might help. SAVE before
trying this:

Sub MoveData()
Dim i As Long
Dim j As Integer
On Error GoTo ErrorHandler
Application.ScreenUpdating = False
For i = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
For j = 1 To 10
Cells(i + j, 1).EntireRow.Insert
Cells(i + j, 1).Value = Cells(i, j + 1).Value
Next j
Range(Cells(i, 2), Cells(i, 11)).ClearContents
Next i
ErrorHandler:
Application.ScreenUpdating = True
End Sub

Hope this helps
Rowan

Extreem wrote:
Hello,

I have a simple spreadsheet with 2000 vendors names in the first column A
and address ect data in columns B - K. How can I get the data to reformat to
have column A list the vendor name in Cell A1 and all the other info be
presnet in B1-10 and then continue for all 2000 vendor names. I've torn my
hair out over this....I'm sure it's simple but I haven't had any luck at
all... Any thoughts appreciated.

Thank You,

Extreem



Rowan Drummond

Modifying data
 
You're welcome.

Extreem wrote:
Thank You ! The code worked exactly as I had hoped.....

Extreem



All times are GMT +1. The time now is 01:33 AM.

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