Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command button to search column
I have not coded in Excel before but have done some in
Access. I recently received a request to do the following: In an Excel 2000 spreadsheet, I would like to be able to press a command button, bring up a textbox that asks the user for part of a search string for column "B" (can it use wildcards?), and finally, go to the row where the searched value exists. TIA, Al |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command button to search column
Al,
Sub Find_in_column_B() Dim FindString As String FindString = InputBox("Enter string to find, use '?' and '*' as appropriate", "Find what in column B") Columns("B:B").Select Selection.Find(What:=FindString, After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Activate End Sub Then Assign it to a button on a user toolbar (open Excel help in the Answer Wizard and enter "assign a macro to a button") Steve "Al" wrote in message ... I have not coded in Excel before but have done some in Access. I recently received a request to do the following: In an Excel 2000 spreadsheet, I would like to be able to press a command button, bring up a textbox that asks the user for part of a search string for column "B" (can it use wildcards?), and finally, go to the row where the searched value exists. TIA, Al |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command button to search column
The built in Find command does this
you can display that dialog with Private Sub CommandButton1_Click() Columns(2).Select application.Dialogs(xlDialogFormulaFind).Show End Sub or just use the shortcut key Ctrl+F Yes, you can use wildcards. If it finds the target, it will select the cell. -- Regards, Tom Ogilvy "Al" wrote in message ... I have not coded in Excel before but have done some in Access. I recently received a request to do the following: In an Excel 2000 spreadsheet, I would like to be able to press a command button, bring up a textbox that asks the user for part of a search string for column "B" (can it use wildcards?), and finally, go to the row where the searched value exists. TIA, Al |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Command Button | Excel Discussion (Misc queries) | |||
command button add another command | Excel Discussion (Misc queries) | |||
command button | Excel Worksheet Functions | |||
command button | Excel Discussion (Misc queries) | |||
Command Button vs Form Button | Excel Programming |