Hi Rick and Joel,
I appreciate your help and I guess my explanation wasn't completely clear,
so I will try it again and hopefully I won't make it worse.
The Imported CSV information will be going onto and overwriting any existing
information already on the sheet. And this is expected and it's ok because
when the initial search query is done within the sales-management
application, the search is always based on a new "date", so the information
on the spreadsheet needs to be replaced.
I am going to try the macro that you gave me, but it's been a very long time
since I programmed code, so if you can give me any pointers that would be
appreciated.
Thanks J.
"Rick Rothstein (MVP - VB)" wrote:
> I didn't get the impression this was being done in an already populated
> column (mainly because the example showed the starting row as 2); but, of
> course, given the example nature of the message, you could very well be
> right.
>
> Rick
>
>
> "Joel" <(E-Mail Removed)> wrote in message
> news
C2B7D45-EC4B-4A28-B202-(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in message
> >> news:6095B719-99FF-4E5D-B222-(E-Mail Removed)...
> >> >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.
> >> >
> >> >
> >>
> >>
>
>