A
astro_al
Hi, I need a few quick pointers if possible. I'm trying to create a
visualbasic routine which will format a text file imported into excel.
The text files represent a small database with about 5 columns, but
fairly long - up to about 100 pages.
After importing, each line (row) is in the leftmost column of the
spreadsheet (ie each line is in a single cell), the data is not
delimited in any useful way.
My questions are as follows:
1. How can I delete an unknown number of spaces (varies) from the
beginning of the text string in each cell?
2. How can I find out the coordinates of the selected cell - ie if I
'Find' in a column and it stops when it finds what I'm looking for, how
can I read in the value of the row number?
3. My general approach is going to be a loop which takes each 'line',
ie cell in the first column, in turn and compares the first part to a
set of if statements, for example, the beginning of the line might say
'STAGE "...' so it'll run through until it finds the if statement
saying 'STAGE"...' and operate on the rest of the line accordingly
(make sense?). There are only about 20 things that each line might
start with, so this seemed the easiest way.
Is there an easier way?!
Cheers for any help, Al.
------------------------------------------------
-- View and post Excel related usenet messages directly from http://www.ExcelTip.com/forum
at http://www.ExcelTip.com/
------------------------------------------------
visualbasic routine which will format a text file imported into excel.
The text files represent a small database with about 5 columns, but
fairly long - up to about 100 pages.
After importing, each line (row) is in the leftmost column of the
spreadsheet (ie each line is in a single cell), the data is not
delimited in any useful way.
My questions are as follows:
1. How can I delete an unknown number of spaces (varies) from the
beginning of the text string in each cell?
2. How can I find out the coordinates of the selected cell - ie if I
'Find' in a column and it stops when it finds what I'm looking for, how
can I read in the value of the row number?
3. My general approach is going to be a loop which takes each 'line',
ie cell in the first column, in turn and compares the first part to a
set of if statements, for example, the beginning of the line might say
'STAGE "...' so it'll run through until it finds the if statement
saying 'STAGE"...' and operate on the rest of the line accordingly
(make sense?). There are only about 20 things that each line might
start with, so this seemed the easiest way.
Is there an easier way?!
Cheers for any help, Al.
------------------------------------------------
-- View and post Excel related usenet messages directly from http://www.ExcelTip.com/forum
at http://www.ExcelTip.com/
------------------------------------------------