Get and manipulate data from cells

N

Nina

I am importing information into Excel from another program in the form of two
columns, one with strings and one with numbers. Basically I want to read the
contents of each cell in the column with strings, assign the first character
of the string to a variable, and test this variable against the letter "A".
If the it doesn't start with A I want to delete the row. Here is a summary:

For Loop to go through all the rows in column 3
Get string from active cell
Assign first character of string to a variable
IF variable != 'A'
delete row and shift up


For example: the active cell reads "L1". I want to a variable that is
assigned to 'L' and test it against the character 'A'. Obviously they're not
the same so now I need to delete the row.

The For loop is another problem. The number of rows is not set so it changes
with every set of info I import into Excel. How do I determine the upper
bound for the loop? Any help would be wonderful. Thanks!
 
J

Joseph R. Pottschmidt

Dear Nina:

Is this an operation that you're trying to import into MS Access or
Import in MS Excel?

This forum is for MS Access questions.

If you're trying to do this in MS Access, you would simply link the MS
Excel Sheet to MS Access and then use an Append Query to filter out all
the unwanted rows.

Joe P.


-----Original Message-----
From: Nina [mailto:[email protected]]
Posted At: Thursday, July 06, 2006 9:51 AM
Posted To: microsoft.public.access.macros
Conversation: Get and manipulate data from cells
Subject: Get and manipulate data from cells

I am importing information into Excel from another program in the form
of two
columns, one with strings and one with numbers. Basically I want to read
the
contents of each cell in the column with strings, assign the first
character
of the string to a variable, and test this variable against the letter
"A".
If the it doesn't start with A I want to delete the row. Here is a
summary:

For Loop to go through all the rows in column 3
Get string from active cell
Assign first character of string to a variable
IF variable != 'A'
delete row and shift up


For example: the active cell reads "L1". I want to a variable that is
assigned to 'L' and test it against the character 'A'. Obviously they're
not
the same so now I need to delete the row.

The For loop is another problem. The number of rows is not set so it
changes
with every set of info I import into Excel. How do I determine the upper

bound for the loop? Any help would be wonderful. Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top