Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
l want write a simple marco to auto find a number in a long range o
number...like the following: . A B 1 1 59 2 77 90 3 99 103 4 111 145 5 150 170 6 187 200 the value in A and B is mean from A to B.....like row 1..it mean 1, 2, 3, up to 59....and so on of other rows.... what l want is have a inputbox for me to input a value like 155.... and l need find in row 1's (A1: B1) ....then row'2 A and B ..until en of row... if the number what l input is in the those range...then msgbox show m have this number.... Pls help...........th -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
dickychan,
Try something like this, assuming your data starts in cell A1, and there is nothing else in column A besides your table. Sub FindNumberRow() Dim myNum As Integer myNum = Application.InputBox("What number?") If myNum = Application.Min(Range("A:B")) And _ myNum <= Application.Max(Range("A:B")) Then MsgBox "It's in row " & Application.Match( _ myNum, Range("A:A")) Else MsgBox "You picked a number out of my range!" End If End Sub HTH, Bernie MS Excel MVP "dickychan " wrote in message ... l want write a simple marco to auto find a number in a long range of number...like the following: A B 1 1 59 2 77 90 3 99 103 4 111 145 5 150 170 6 187 200 the value in A and B is mean from A to B.....like row 1..it mean 1, 2, 3, up to 59....and so on of other rows.... what l want is have a inputbox for me to input a value like 155.... and l need find in row 1's (A1: B1) ....then row'2 A and B ..until end of row... if the number what l input is in the those range...then msgbox show me have this number.... Pls help...........thx --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thx very much....it solved my problem..thanka lot
--- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Write formula for simple copy and paste to another cell | Excel Worksheet Functions | |||
Help I need to know how to write a simple formula, not having any | Excel Discussion (Misc queries) | |||
How to write a simple copy-paste macro? | New Users to Excel | |||
Create and write a simple text file in Excel/VBA | Excel Programming | |||
write marco to put data from sheet to memory | Excel Programming |