Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find
How do i code a macro to find a value in a specific range of cells. The value
to locate will be typed by the user in a cell Cells.Find(What:=B3, LookIn:=b5:b500).Activate ?????? Any suggestions please thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find
Dim FoundCell as Range
with activesheet set foundcell = .range("b5:b500").find(what:=.range("b3").value) if foundcell is nothing then msgbox "not found" else foundcell.activate end if end with judith wrote: How do i code a macro to find a value in a specific range of cells. The value to locate will be typed by the user in a cell Cells.Find(What:=B3, LookIn:=b5:b500).Activate ?????? Any suggestions please thanks -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find
Hi,
Try; Range("b5:b500").Find(What:=Range("B3")).Activate Regards, Chris. -- Chris Marlow MCSD.NET, Microsoft Office XP Master "judith" wrote: How do i code a macro to find a value in a specific range of cells. The value to locate will be typed by the user in a cell Cells.Find(What:=B3, LookIn:=b5:b500).Activate ?????? Any suggestions please thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find
Dave,
I tried this and it worked for me to an extent. It found the correct cell but then I get Run-time error '424': Object required here is what I have Sub findreq() Dim FoundCell As Range With ActiveSheet Set FoundCell = .Range("b4:b500").Find(What:=.Range("r1")).Activat e If FoundCell Is Nothing Then MsgBox "not found" Else FoundCell.Activate End If End With End Sub how do I get rid of the error? "Dave Peterson" wrote: Dim FoundCell as Range with activesheet set foundcell = .range("b5:b500").find(what:=.range("b3").value) if foundcell is nothing then msgbox "not found" else foundcell.activate end if end with judith wrote: How do i code a macro to find a value in a specific range of cells. The value to locate will be typed by the user in a cell Cells.Find(What:=B3, LookIn:=b5:b500).Activate ?????? Any suggestions please thanks -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find First Non blank cell than find column header and return that value | Excel Worksheet Functions | |||
Despite data existing in Excel 2002 spreadsheet Find doesn't find | Excel Discussion (Misc queries) | |||
find and delete duplicate entries in two columns or find and prin. | Excel Programming | |||
find and delete text, find a 10-digit number and put it in a textbox | Excel Programming | |||
backwards find function to find character in a string of text | Excel Programming |