![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Posts: 1
|
I'd like to write a macro that uses a button on the worksheet that does an Edit/Find.
Thank you. |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Sydney/Brisbane , Australia
Posts: 539
|
sub findnow
finderword = inputbox ("Please enter the VALUE to find") Cells.Find(What:=finderword, After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False).Activate End Sub |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
what are you trying to find numbers or letters?
|
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
try this
Sub findnow() Dim finderword On Error GoTo errorman finderword = (CVar(InputBox("Please enter the VALUE to find"))) If finderword = Empty Then Exit Sub Cells.Find(What:=(finderword), After:=ActiveCell, LookIn:=xlValues, LookAt:= _ xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _ , SearchFormat:=False).Activate Exit Sub errorman: msg = MsgBox("Requested Value Not Found, Try Again?", vbYesNo + vbCritical, "VALUE NOT FOUND") If msg = vbYes Then findnow End Sub if file is not found it will ask to try again that help _________________ also if you want to edit the cell when you find it post back [ This Message was edited by: brettvba on 2002-05-07 16:31 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|