Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Rick: I think you have to insert rows otherwise you are going to overwrite
data in next row. I posted this solution in a newer posting. "Rick Rothstein (MVP - VB)" wrote: If Joel's guess if wrong, then for the example you posted, this macro will move the row of data to the column you specified... Sub MoveRow2Data() Dim X As Long, Z As Long Dim LastColumn As Long Const StartCol As Long = 9 Const GroupCount As Long = 5 Const MoveToColumn As Long = 4 Const DataRow As Long = 2 With Worksheets("Sheet1") LastColumn = .Cells(DataRow, .Columns.Count).End(xlToLeft).Column For X = StartCol To LastColumn Step 5 For Z = 0 To GroupCount - 1 .Cells(DataRow, X + Z).Copy _ Destination:=.Cells(X - 9 + DataRow + Z, MoveToColumn) Next Next .Cells(DataRow, StartCol).Resize(1, LastColumn - _ StartCol + 1).ClearContents End With End Sub Rick "J" wrote in message ... I am importing CSV records from a sales management application and the information, when imported, hits the sheet in the columns and each range needs to be moved into the correct columns. (This imported information is of a different size each time it is imported. ) Also, there will be several ranges of records that will have to be moved under the same identified column. Example: move I2 thru M2 to D2 move N2 thru R2 to D3 move S2 thru W2 to D4 (and so on until it finds the last record with the same import code) I have identified the columns that this information needs to be moved into, however I do not know the formula or code to tell it to do this? Can anyone help me? Thanks, J. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I put in information without the page moving | Excel Discussion (Misc queries) | |||
moving Imported information | Excel Discussion (Misc queries) | |||
Moving Data Automaticaly | New Users to Excel | |||
Moving Information | Excel Worksheet Functions | |||
how do i can send a information of cell automaticaly via email? | New Users to Excel |