Assuming all your values fall on rows 3-8 this would be one approach:
Function MultipleRange(Entry)
Dim strLetters As String
Dim lngValues As Long
Dim I As Integer
strLetters = Left(Entry, 4)
lngValues = Right(Entry, 7)
If Cells(3, 1) = strLetters Then
x = 1
For I = 3 To 5
If Cells(I, 2) < lngValues Then
MultipleRange = x
I = 5
Else
x = x + 1
End If
Next I
ElseIf Cells(6, 1) = strLetters Then
x = 4
For I = 6 To 8
If Cells(I, 2) < lngValues Then
MultipleRange = x
I = 8
Else
x = x + 1
End If
Next I
End If
End Function
---In excelvba@yahoogroups.com, <MohdNoor@...> wrote:
HI All,
I need help
I have a list of list that I want to check if its fall between below table ,
Example : abcd3501099 if falls between below range will return as 1 , and the list continues..
| Range1 | Range2 |
abcd | 3501070 | 3517069 |
abcd | 1270420 | 1273919 |
abcd | 9443430 | 9443439 |
wrst | 3598110 | 3638109 |
wrst | 1567260 | 1572259 |
wrst | 9877010 | 9887009 |
Best Regards,
MOhdnoor
Disclaimer: This e-mail and any attachment(s) hereto is only for the use of the intended recipient(s) and may contain information that is confidential and/or privileged under applicable laws.
If you are not the intended recipient(s), any use of, reliance on, reference to, disclosure of, alteration to or copying of the information for any purpose is prohibited.
Any information not related to PTP's official business is solely the author's and does not necessarily represent PTP's view and is not necessarily endorsed by PTP.
PTP shall not be liable for any loss or damage caused by viruses transmitted through this e-mail or its attachments.
PTP is not responsible for any unauthorised changes made to the information or for any subsequent effects caused as a result of such changes.
If you have received this e-mail by error, please notify the sender by replying this email and discard all its contents immediately.
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (9) |
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.
----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA
----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com
----------------------------------
Tidak ada komentar:
Posting Komentar