Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find value in range
Hi all,
I'm looking for an efficient way to find the row in a sheet with a matching value in column A to a textbox value on a userform. The userform is used to gather record information from the user and update the spreadsheet. The spreadsheet can accumulate upwards of 100+ records and the user form is the only way to navigate the data - I need a way to "jump" to a specific record. The txtActivityNo would be the unique record identifier. help? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find value in range
Give this a try...
Sub FindActivityNumber() Dim wksToSearch As Worksheet Dim rngToSearch As Range Dim rngFound As Range Set wksToSearch = Sheets("Sheet1") Set rngToSearch = wksToSearch.Columns("A") Set rngFound = rngToSearch.Find(What:=txtActivityNo, _ LookIn:=xlFormulas, _ LookAt:=xlWhole, _ MatchCase:=False) If rngFound Is Nothing Then MsgBox "Sorry " & txtActivityNo & " was not found." Else wksToSearch.Select rngFound.Select End If End Sub -- HTH... Jim Thomlinson "TimT" wrote: Hi all, I'm looking for an efficient way to find the row in a sheet with a matching value in column A to a textbox value on a userform. The userform is used to gather record information from the user and update the spreadsheet. The spreadsheet can accumulate upwards of 100+ records and the user form is the only way to navigate the data - I need a way to "jump" to a specific record. The txtActivityNo would be the unique record identifier. help? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find value in range
BRILLIANT!!!!
Works perfectly, thank you! "Jim Thomlinson" wrote: Give this a try... Sub FindActivityNumber() Dim wksToSearch As Worksheet Dim rngToSearch As Range Dim rngFound As Range Set wksToSearch = Sheets("Sheet1") Set rngToSearch = wksToSearch.Columns("A") Set rngFound = rngToSearch.Find(What:=txtActivityNo, _ LookIn:=xlFormulas, _ LookAt:=xlWhole, _ MatchCase:=False) If rngFound Is Nothing Then MsgBox "Sorry " & txtActivityNo & " was not found." Else wksToSearch.Select rngFound.Select End If End Sub -- HTH... Jim Thomlinson "TimT" wrote: Hi all, I'm looking for an efficient way to find the row in a sheet with a matching value in column A to a textbox value on a userform. The userform is used to gather record information from the user and update the spreadsheet. The spreadsheet can accumulate upwards of 100+ records and the user form is the only way to navigate the data - I need a way to "jump" to a specific record. The txtActivityNo would be the unique record identifier. help? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find Last cell in Range when range is date format | Excel Discussion (Misc queries) | |||
Find a range of values in a range of cells | Excel Worksheet Functions | |||
Find the POSITION IN A RANGE of text in a string that matches value(s) in a range | Excel Programming | |||
Find dates in a range; then sum values in that range by a criteria | Excel Discussion (Misc queries) | |||
Find first cell in range and expand range -VBA | Excel Programming |