Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help.. want write a simple marco

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default help.. want write a simple marco

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help.. want write a simple marco

thx very much....it solved my problem..thanka lot


---
Message posted from http://www.ExcelForum.com/

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Write formula for simple copy and paste to another cell Kalffiend Excel Worksheet Functions 1 January 12th 10 09:10 PM
Help I need to know how to write a simple formula, not having any cbexcel Excel Discussion (Misc queries) 4 December 7th 06 09:36 PM
How to write a simple copy-paste macro? R. H. Rosenberg New Users to Excel 4 November 25th 06 12:26 AM
Create and write a simple text file in Excel/VBA Thomas Wieser Excel Programming 4 April 13th 04 10:24 AM
write marco to put data from sheet to memory Desmond Leung Excel Programming 3 July 30th 03 05:27 AM


All times are GMT +1. The time now is 06:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"