VBA - Choosing rows based on a criteria

  • Thread starter Thread starter nondisclosure007
  • Start date Start date
N

nondisclosure007

et al,

If this is the wrong group, please point me in the right direction.

What I want to do is choose rows in a spreadsheet based on a criteria
(yes, I know I could filter to get it), but I want to be able to have
them chosen from w/in VBA as I plan to take data in said row and build
and send an e-mail with it.

I'm only looking for the first part, right now. How to choose a row
based on criteria.

Once I have that, I'll probably just write it out to a text file to
make sure it works.

Then, if it shows that it works, I'll go ahead and take out the 'text
file' and replace it w/ building and sending e-mail.

Any help is greatly appreciated.

thx.
-Michael
 
Try using filter in Excel with the macro recorder switched, it will show you
most of the code needed.
 
Thanks all. I am totally blonde, I completely forgot about using the
Macro Recoreder. I'll have to take some blonde juice later! :)

Now that I've got the data sorted, What I'm looking to do is write to a
file the specific rows I sorted on. One record per line.

I know, it sounds re-dundant, but it's part of a larger picture.

fyi. the column value for the records I need write is x. if there's
an x in that comlumn for a record, write the record to a text file.

Now, since it's been over a decade since I last coded, I can't figure
out to start with what kind of loop to do. For, while, etc.

How would I read the data from Excel into an array (that's the key so
far).

BTW, the code that the macro created was very easy to read and edit
(had to take out a bunch of windows scroll (ex:
ActiveWindow.SmallScroll ToRight:=14) statements.

Thanks again all!
-Michael
 
Back
Top