Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reverse find 1

Status
Not open for further replies.

Luis939

MIS
Feb 28, 2003
453
US
Is there any way to do the ctrl+find method but in reverse instead of its normal way in Excel, but not search for the same thing as before, I want to look for something different
thanks!
 
Hi 4335,

Not sure what you mean by not search for the same thing as before. Any search can be for anything, and in any direction. Use What:="Your Search Text" to specify what you are looking for and SearchDirection:=xlPrevious to look backwards or upwards.

Enjoy,
Tony
 
oh ok, yea I didnt know about the xlPrevious parameter, that really helps, thanks!!
 
Is there any way to bring up a blank Search Dialog so that a user can enter their Search Parameter in themselves?

I have created a spreadsheet (Excel97) and I would like to have a Search Button that when clicked brings up the Find (CTRL+F) function where the user can then enter a client's Last Name to see if it has already been entered in the spreadsheet. So far I have not seen any function that will bring up the dialog box with nothing in it.

Pronunciation: 'lO-kE
Function: noun
Etymology: Old Norse
Definition: a Norse god who contrives evil and mischief for his fellow gods
 
I dont understand your question, wouldnt the Find dialogue box provide you with the necessary search parameters, what else would you want, and what do you mean come up a blank search dialgue, unless you mean that you dont want the old text that was searched before to come up again, please be a little more specific, thank you
 
If you press CTRL+F it brings up the Find Dialogue Box with the blinking cursor waiting for you to enter something. That is what I am looking for.

I want to basically assign CTRL+F to a Command Button.

I hope that clarifies for you.

Pronunciation: 'lO-kE
Function: noun
Etymology: Old Norse
Definition: a Norse god who contrives evil and mischief for his fellow gods
 
Well I hope this is your solution, what I did was I basically right-clicked on the menu and chose the last option, which is customize, i selected the "commands" tab, then on the left hand side i chose the "Edit" Category, which is the second category there, then on the right hand side of that same window i scrolled down to the end until i saw the Find command with the icon of the binoculars next to it, and then I simply clicked and dragged it to one of my toolbars, i closed the customize box, and now I have my icon to do what you asked, hoped that helped
 
heh. I have a spreadsheet that I created for a user. In that spreadsheet I have several custom buttons that I have added (call them button1, button2, button3, etc.). They are all Command Buttons created using the Control Toolbox, and selecting Command Button, thereby allowing me to code them however way I want.

I want button2 to act like the Find button available in the toobar. I am trying to make this spreadsheet as easy to use for this user (computer illiterate user) as possible. I will name the button "Search for a Client" so that the user can easily identify it. She will click the button and the Find dialog box will appear with the blinking cursor, waiting for her to enter the search item.

I apologize for my inability to clearly get across what I am looking for.

Pronunciation: 'lO-kE
Function: noun
Etymology: Old Norse
Definition: a Norse god who contrives evil and mischief for his fellow gods
 
Well sorry, ive never created buttons like that, i do know the visual basic code though for the find method, its

Cells.Find(What:=" Last Name ", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False) _
.Activate

I dont know if that will help you, sorry.
 
Have you tried

Range("a1").Select
SendKeys "^f"

The Range select will just give focus back to the sheet so that the sendkeys statement works.This should then bring up the find dialog box as if you have pressed Ctrl-F yourself.

Works fine for me in Excel 2000.

HTH

Matt
 
how does the sendkeys statement work, ive never seen it?? thank you
 
Matt .. THANK YOU VERY MUCH!!!! wooohoo! I just posted something about this (because I figured this post was a dead topic now) and then you answered my question here. :\ /does the happy dance.

I had all of the coding except for the Range bit. I didn't realize that SendKeys needed to have the sheet "Focused".

4335 ...

Here is what Visual Basic Help has on SendKeys:

SendKeys Method


Sends keystrokes to the active application.

Syntax

expression.SendKeys(Keys, Wait)

expression Optional. An expression that returns an Application object.

Keys Required Variant. The key or key combination you want to send to the application, as text.

Wait Optional Variant. True to have Microsoft Excel wait for the keys to be processed before returning control to the macro. False (or omitted) to continue running the macro without waiting for the keys to be processed.

Remarks

This method places keystrokes in a key buffer. In some cases, you must call this method before you call the method that will use the keystrokes. For example, to send a password to a dialog box, you must call the SendKeys method before you display the dialog box.

The Keys argument can specify any single key or any key combined with ALT, CTRL, or SHIFT (or any combination of those keys). Each key is represented by one or more characters, such as "a" for the character a, or "{ENTER}" for the ENTER key.

To specify characters that aren't displayed when you press the corresponding key (for example, ENTER or TAB), use the codes listed in the following table. Each code in the table represents one key on the keyboard.

Key Code
BACKSPACE {BACKSPACE} or {BS}
BREAK {BREAK}
CAPS LOCK {CAPSLOCK}
CLEAR {CLEAR}
DELETE or DEL {DELETE} or {DEL}
DOWN ARROW {DOWN}
END {END}
ENTER (numeric keypad) {ENTER}
ENTER ~ (tilde)
ESC {ESCAPE} or {ESC}
HELP {HELP}
HOME {HOME}
INS {INSERT}
LEFT ARROW {LEFT}
NUM LOCK {NUMLOCK}
PAGE DOWN {PGDN}
PAGE UP {PGUP}
RETURN {RETURN}
RIGHT ARROW {RIGHT}
SCROLL LOCK {SCROLLLOCK}
TAB {TAB}
UP ARROW {UP}
F1 through F15 {F1} through {F15}


You can also specify keys combined with SHIFT and/or CTRL and/or ALT. To specify a key combined with another key or keys, use the following table.

To combine a key with Precede the key code with
SHIFT + (plus sign)
CTRL ^ (caret)
ALT % (percent sign)

Pronunciation: 'lO-kE
Function: noun
Etymology: Old Norse
Definition: a Norse god who contrives evil and mischief for his fellow gods
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top