Forum Discussion
Sorting data - by reference
Unfortunately all the dates are different so I need all the lines to import into the database.
I just need to split the data so there's only one line for each reference on each page.
To do it for the first lot of data I sorted references and then went down numbering them 1,2,3 etc and then moving all 1's onto a a new tab, all 2's onto a new tab etc.
Sadly my eyes let me down and there were a few references with several dates on one page.
Therefore the import failed.
Does that make sense?
Hi,
So you want reference 119737 in one CSV file, 119807 in another CSV file and for each reference you need each file.
1. Sort values in Reference
2. Use the Macro to split each reference.
Sub Macro1()
Dim a As Double
b = Range("A1048576").End(xlUp).Row
For a = b To 2 Step -1
Range("B" & a).Select
If Range("B" & a).Value <> Range("B" & a - 1).Value Then
Selection.EntireRow.Insert
ActiveCell.Offset(-1, 0).Select
End If
Next a
End Sub
- LauraDaisyMay 01, 2018Copper Contributor
Hi sorry, i dont think i explained it very well.
Are you still available to offer assistance?
What I need is each reference with its date in different CSV files - no one file can have a duplicate reference.
- Logaraj SekarMay 01, 2018Iron Contributor
Hi,
I can able to paste in different excel file and save as CSV. But i get struggled while naming it.
- LauraDaisyMay 01, 2018Copper Contributor
thanks :)
- LauraDaisyApr 25, 2018Copper Contributor
Thanks. I actually need to learn macro and VBA.
Do you know a good (free) site I can train myself on?
Thanks again :)
- Logaraj SekarMay 01, 2018Iron Contributor