ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find Number On Active Sheet (https://www.excelbanter.com/excel-programming/388821-find-number-active-sheet.html)

Sue

Find Number On Active Sheet
 
Hi All

I have a TextBox on a Userform TB1 I want to enter a number in the text box
click a CommandButton Com1 and find a number listed in column F - starting
from Row3 and ending in Row94 using the active sheet in the workbook. The
numbers are set to Text because I use a lot of leading zero's (any way of
getting rid of that annoying green tag on each cell) Is it possible to have a
macro that will do this and if so can you please guide me in the right
direction.
--
Many Thanks

Sue

Jim Cone

Find Number On Active Sheet
 
Sue,
"that annoying green tag"
On the Tools menu, click Options and then click the Error Checking tab.
Clear the Enable background error checking check box.

"macro that will do this"
The 'match' function can be use with code by using a prefix...
Application.WorksheetFunction.Match
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Sue"
wrote in message
Hi All
I have a TextBox on a Userform TB1 I want to enter a number in the text box
click a CommandButton Com1 and find a number listed in column F - starting
from Row3 and ending in Row94 using the active sheet in the workbook. The
numbers are set to Text because I use a lot of leading zero's (any way of
getting rid of that annoying green tag on each cell) Is it possible to have a
macro that will do this and if so can you please guide me in the right
direction.
--
Many Thanks
Sue

Gary''s Student

Find Number On Active Sheet
 
have your button code call:

Sub findit(s As String)
Set r = Intersect(ActiveSheet.UsedRange, Range("F3:F94"))
For Each rr In r
If rr.Value = s Then
rr.Select
Exit Sub
End If
Next
End Sub

where s will be the value sought
--
Gary''s Student - gsnu200719

Sue

Find Number On Active Sheet
 
Hi Gary

Re; where will the value be sought : I have 3 other TextBoxes and on finding
the info entered in TB1. I wanted these TextBoxes to fill with the info from
the sheet. e.g

TB1 finds the info on Row70 therefore
TB2 = the Value in cell D70
TB3 = the value in cell C70
TB4 = the value in cell B70

I can then find out quickly who sold what to whom.

The problem also is that the commandbutton "Find1" is normally a click
procedure, I have tried but I don't know how to call or attach the code to it.

Just a learner trying to make things easier for myself.

--
Many Thanks

Sue


"Gary''s Student" wrote:

have your button code call:

Sub findit(s As String)
Set r = Intersect(ActiveSheet.UsedRange, Range("F3:F94"))
For Each rr In r
If rr.Value = s Then
rr.Select
Exit Sub
End If
Next
End Sub

where s will be the value sought
--
Gary''s Student - gsnu200719



All times are GMT +1. The time now is 11:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com