Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Find macro on columns A,B and C.

I have an Excel 2003 spreadsheet with Lastname Firstname and Teamname as
columns A-C. The sheet is sorted on these three columns in the order stated.
Columns D thru T contain other teamnames played.

I am writing a macro that put's up an InputBox requesting the user to enter
a Lastname, Firstname, Teamname separated by commas such as:
Lastname2,Jill,Team1 to find the row for "Jill Lastname2".

I used the macro recorder to create a macro that does a Find on Col A then B
then C. Problem is, when I find the Lastname in Col A then select Column B
and issue a Find command for the Firstname, the Find starts from the top of
column B when I want it to begin with the row that contained the lastname
successfully found in column A. There is an After: property associated with
the Find command but I don't know how to assign the row number where the
lastname was found to that After: property.


Sample Data

Lastname1 Jill Team1
Lastname2 Jill Team1
Lastname2 Mary Team1

When I enter "Lastname2,Jill,Team1" the first Find in my macro successfully
finds row 2, but the next Find stops at the Jill name in Column B identifying
the wrong row.

Any and all help is appreciated.

Jack
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default Find macro on columns A,B and C.

This may help
http://www.ozgrid.com/VBA/advanced-find.htm

--
Steve

"JackGombola" wrote in message
...
I have an Excel 2003 spreadsheet with Lastname Firstname and Teamname as
columns A-C. The sheet is sorted on these three columns in the order
stated.
Columns D thru T contain other teamnames played.

I am writing a macro that put's up an InputBox requesting the user to
enter
a Lastname, Firstname, Teamname separated by commas such as:
Lastname2,Jill,Team1 to find the row for "Jill Lastname2".

I used the macro recorder to create a macro that does a Find on Col A then
B
then C. Problem is, when I find the Lastname in Col A then select Column
B
and issue a Find command for the Firstname, the Find starts from the top
of
column B when I want it to begin with the row that contained the lastname
successfully found in column A. There is an After: property associated
with
the Find command but I don't know how to assign the row number where the
lastname was found to that After: property.


Sample Data

Lastname1 Jill Team1
Lastname2 Jill Team1
Lastname2 Mary Team1

When I enter "Lastname2,Jill,Team1" the first Find in my macro
successfully
finds row 2, but the next Find stops at the Jill name in Column B
identifying
the wrong row.

Any and all help is appreciated.

Jack


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Find macro on columns A,B and C.

Hello Jack,

I don't know what you want to do with the data after finding and this
suggestion might not be suitable but have you thought about using AutoFilter?

If you have not used it before then simply click anywhere in your data and
Select the menu item Data - Filter - AutoFilter. (This is a toggle action
so you turn it off the same way.)

You then only have to click the drop down arrows and make your selections on
the various columns. (Note that if you only select a value in the Team column
then it will display the entire team.)

Editing of the code is required on recorded macros using Find otherwise the
code will fail and stop if it does not find the required data.

If this suggestion will not do what you want and you still want to run with
the Find then post the code you have so far and I will have a look at it.

--
Regards,

OssieMac


"JackGombola" wrote:

I have an Excel 2003 spreadsheet with Lastname Firstname and Teamname as
columns A-C. The sheet is sorted on these three columns in the order stated.
Columns D thru T contain other teamnames played.

I am writing a macro that put's up an InputBox requesting the user to enter
a Lastname, Firstname, Teamname separated by commas such as:
Lastname2,Jill,Team1 to find the row for "Jill Lastname2".

I used the macro recorder to create a macro that does a Find on Col A then B
then C. Problem is, when I find the Lastname in Col A then select Column B
and issue a Find command for the Firstname, the Find starts from the top of
column B when I want it to begin with the row that contained the lastname
successfully found in column A. There is an After: property associated with
the Find command but I don't know how to assign the row number where the
lastname was found to that After: property.


Sample Data

Lastname1 Jill Team1
Lastname2 Jill Team1
Lastname2 Mary Team1

When I enter "Lastname2,Jill,Team1" the first Find in my macro successfully
finds row 2, but the next Find stops at the Jill name in Column B identifying
the wrong row.

Any and all help is appreciated.

Jack

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Find macro on columns A,B and C.

Thanks. I hadn't considered the AutoFilter. I'll check it out. jg

"OssieMac" wrote:

Hello Jack,

I don't know what you want to do with the data after finding and this
suggestion might not be suitable but have you thought about using AutoFilter?

If you have not used it before then simply click anywhere in your data and
Select the menu item Data - Filter - AutoFilter. (This is a toggle action
so you turn it off the same way.)

You then only have to click the drop down arrows and make your selections on
the various columns. (Note that if you only select a value in the Team column
then it will display the entire team.)

Editing of the code is required on recorded macros using Find otherwise the
code will fail and stop if it does not find the required data.

If this suggestion will not do what you want and you still want to run with
the Find then post the code you have so far and I will have a look at it.

--
Regards,

OssieMac


"JackGombola" wrote:

I have an Excel 2003 spreadsheet with Lastname Firstname and Teamname as
columns A-C. The sheet is sorted on these three columns in the order stated.
Columns D thru T contain other teamnames played.

I am writing a macro that put's up an InputBox requesting the user to enter
a Lastname, Firstname, Teamname separated by commas such as:
Lastname2,Jill,Team1 to find the row for "Jill Lastname2".

I used the macro recorder to create a macro that does a Find on Col A then B
then C. Problem is, when I find the Lastname in Col A then select Column B
and issue a Find command for the Firstname, the Find starts from the top of
column B when I want it to begin with the row that contained the lastname
successfully found in column A. There is an After: property associated with
the Find command but I don't know how to assign the row number where the
lastname was found to that After: property.


Sample Data

Lastname1 Jill Team1
Lastname2 Jill Team1
Lastname2 Mary Team1

When I enter "Lastname2,Jill,Team1" the first Find in my macro successfully
finds row 2, but the next Find stops at the Jill name in Column B identifying
the wrong row.

Any and all help is appreciated.

Jack

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
Find & Replace and Find & Insert macro help needed RS Excel Programming 2 January 29th 07 07:35 AM
Macro to find columns to hide Dean[_8_] Excel Programming 8 June 14th 06 03:58 AM
Looping macro needed to find intersections of rows and columns Clifford Middleton Excel Programming 1 January 5th 06 01:04 PM
I need to find a macro to find data cut and paste to another colu. Rex Excel Programming 6 December 7th 04 09:22 AM
find and delete duplicate entries in two columns or find and prin. campare 2 columns of numbers-find unique Excel Programming 1 November 24th 04 04:09 PM


All times are GMT +1. The time now is 02:51 PM.

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"