ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   moving Imported information (https://www.excelbanter.com/excel-discussion-misc-queries/183098-moving-imported-information.html)

j

moving Imported information
 
I am trying to create a Trust Account spreadsheet and I am importing records
from a sale management application. When the info comes in it fills all the
necessary columns on my spreadsheet however, because this information varies
in length each time (more or less records depending on the activity of the
import) I have to identify each range and then move that range into the
proper column.

Example:

move range I2 thru M2 to D2
move range N2 thru R2 to D3
move range S2 thru W2 to D4

and so on, but remember the number of ranges can be more or less so the
command needs to be able to recognize the end of those particular records.
That way it doesn't move any other ones. (I hope this makes sense)

If anyone can help I would appreciate it. Thanks, J

joel

moving Imported information
 
You need a macro

Sub move_data()

FirstCol = Range("I1").Column
RowCount = 1
Do While Range("A" & RowCount) < ""
ColCount = FirstCol
OldRow = RowCount
Do While Cells(OldRow, ColCount) < ""
RowCount = RowCount + 1
Rows(RowCount).Insert
Range(Cells(OldRow, ColCount), Cells(OldRow, ColCount + 4)).Cut _
Destination:=Range("D" & RowCount)
ColCount = ColCount + 5
Loop
RowCount = RowCount + 1
Loop
End Sub


"J" wrote:

I am trying to create a Trust Account spreadsheet and I am importing records
from a sale management application. When the info comes in it fills all the
necessary columns on my spreadsheet however, because this information varies
in length each time (more or less records depending on the activity of the
import) I have to identify each range and then move that range into the
proper column.

Example:

move range I2 thru M2 to D2
move range N2 thru R2 to D3
move range S2 thru W2 to D4

and so on, but remember the number of ranges can be more or less so the
command needs to be able to recognize the end of those particular records.
That way it doesn't move any other ones. (I hope this makes sense)

If anyone can help I would appreciate it. Thanks, J



All times are GMT +1. The time now is 11:18 AM.

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