resorting columns
This is what I would do, since your sorting may require multipe steps (Excel
Sorts based in Alphabetical order)
First I'd bring the file as it is, setting up an instruction that will split
it in columns using comma as my delimiter.
The second instruction is the one that may be a little slow, depending of
the number of rows in your file...
I would set a range for all of the rows and loop through it, sending each
row to a "Pivot Sheet" using the Paste Special Transpose option, the applying
the sort.
This may require an extra step, since your Hertz and Kilohertz may be mixed
up due to the fact that excel will place IMP_1_KHZ before IMP_100_HZ.
So you probably have to split each string based on your underscore, then do
the sort.
Once is properly sort you will have to do a Paste Special Transpose again
and send it back to the source sheet.
Subsequently saving it as a CSV file.
--
If this posting was helpful, please click on the Yes button.
Regards,
Michael Arch.
"Robert H" wrote:
I use data that is export from electrical test equipment in CSV
format. For years I have been developing vba code to manipulate this
data for analysis. One problem with the data is that it is grouped in
columns in a way that makes analysis and charting cumbersome. I
should have worked this out long ago but must have enjoyed the
struggle.
the data come in in columns like:
TYPE, DATE, DC_RES, IMP_100_Hz, PHASE_100_Hz, LC_100_Hz, QD_100_Hz,
IMP_200_Hz, PHASE_200_Hz, LC_200_Hz, QD_200_Hz, IMP_400_Hz,
PHASE_400_Hz, LC_400_Hz, QD_400_Hz, IMP_1_kHz, PHASE_1_kHz, LC_1_kHz,
QD_1_kHz
The data runs higher in frequency
I need to reorganize the data so that each data type is grouped
together. For instance TYPE, DATE, DC_RES, IMP_100_Hz, IMP_200_Hz,
IMP_400_Hz, IMP_1_kHz, etc
a push towards efficient way to do this would be helpful.
thanks
Robert
|