Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default VBA - Choosing rows based on a criteria

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default VBA - Choosing rows based on a criteria

Try using filter in Excel with the macro recorder switched, it will show you
most of the code needed.


wrote in message
oups.com...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA - Choosing rows based on a criteria


You will probably want to use the UsedRange to say If ActiveRow of
UsedRange = etc.

Try playing around with the code here http://tinyurl.com/8864k which is
for copying an entire UsedRange.

Simon


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=472820

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default VBA - Choosing rows based on a criteria

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Choosing a date from a list based on two criteria southbaysufer Excel Discussion (Misc queries) 2 October 23rd 09 08:59 PM
insert rows based on criteria MP Excel Discussion (Misc queries) 3 December 4th 08 02:19 PM
insert rows based on criteria MP Excel Discussion (Misc queries) 0 December 3rd 08 06:36 PM
Selecting rows based on criteria JCP Excel Discussion (Misc queries) 3 April 5th 06 09:26 AM
Copying whole rows based upon one criteria kirbster1973 Excel Discussion (Misc queries) 2 May 26th 05 10:00 PM


All times are GMT +1. The time now is 11:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"