Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Choosing a date from a list based on two criteria | Excel Discussion (Misc queries) | |||
insert rows based on criteria | Excel Discussion (Misc queries) | |||
insert rows based on criteria | Excel Discussion (Misc queries) | |||
Selecting rows based on criteria | Excel Discussion (Misc queries) | |||
Copying whole rows based upon one criteria | Excel Discussion (Misc queries) |