Hi All
Thank you Frank for the suggestion yo use my cell phone. after a few trails I got it right.
time*treat
I think you wrote this macro, how can I change it to: myNum = InputBox("seaRch foR...", "select a paiR of numbeRs like 16-36", "16-21-36","16-21-28-36","16-21-28-36-41","16-21-28-36-41-50")
This the macro currently:
Sub SeaRchFoRAPaiR_02()
'Oct 12, 2014
Dim myNum As String
myNum = InputBox("seaRch foR...", "select a paiR of numbeRs like 16-36", "16-36")
If myNum = "" Then Exit Sub
Dim v As Variant
v = Split(myNum, "-")
Const FiRstR As Long = 3 '<< souRce data, fiRst Row
Const FiRstC As String = "A" '<< fiRst column
Const LastC As String = "G" '<< last column
Const TaRgetC As String = "Q" '<<< fiRst TaRget Column
Dim ws As Worksheet
Set ws = ActiveSheet
Dim R As Long, c As Long, i As Long, t As Long, N As Long
R = ws.Cells(Rows.Count, FiRstC).End(xlUp).Row
N = ws.UsedRange.Rows.Count
c = ws.Range(ws.Cells(FiRstR, FiRstC), ws.Cells(FiRstR, LastC)).Columns.Count
ws.Range(FiRstC & ":" & LastC).Interior.ColorIndex = xlNone
ws.Cells(1, TaRgetC).Resize(N, c + 1).Clear
If UBound(v) <> 2 Then MsgBox "wRong, select 3 numbeRs": Exit Sub
Application.ScreenUpdating = False
Dim R1 As Range, R2 As Range
t = 2
For i = FiRstR To R
Set R1 = ws.Cells(i, FiRstC).Resize(, c).Find(What:=v(0), LookIn:=xlValues, LookAt:=xlWhole)
Set R2 = ws.Cells(i, FiRstC).Resize(, c).Find(What:=v(1), LookIn:=xlValues, LookAt:=xlWhole)
If Not R1 Is Nothing And Not R2 Is Nothing Then
R1.Interior.Color = RGB(255, 255, 0): R2.Interior.Color = RGB(255, 255, 0)
ws.Range(ws.Cells(i - 1, FiRstC), ws.Cells(i, LastC)).Copy ws.Cells(t, TaRgetC)
ws.Cells(t, TaRgetC).Offset(, c) = "Row " & i - 1: ws.Cells(t + 1, TaRgetC).Offset(, c) = "Row " & i
t = t + 2
End If
Next
R = ws.Cells(Rows.Count, TaRgetC).End(xlUp).Row
If R = 1 Then MsgBox "nothing found": Exit Sub
ws.Range(ws.Cells(1, FiRstC), ws.Cells(1, LastC)).Copy ws.Cells(1, TaRgetC)
ws.Cells(1, TaRgetC).Resize(R, c + 1).EntireColumn.AutoFit
ws.Range(FiRstC & ":" & LastC).Interior.ColorIndex = xlNone
Application.ScreenUpdating = True
End Sub
BlouBul