vba select foundRng cell

gtd526

Well-known Member
Joined
Jul 30, 2013
Messages
657
Office Version
  1. 2019
Platform
  1. Windows
Hello,
How can I select the cell or offset from foundRng?
The code and data are below.
Thanks.

VBA Code:
Sub Test2()
'select the entire range that contains "Parlay"
'gives the cell address of "Parlay"
'works

    Dim foundRng As Range
   
    LastRow = Cells(Rows.Count, "B").End(xlUp).Row      'last row according to "B"
    LastRow2 = Cells(Rows.Count, "C").End(xlUp).Row     'last row according to "C"
    Range("E" & LastRow).Select  'have to select lastRow to select correct range regarding line below
    'Range(Selection, Intersect(Selection.EntireColumn, Rows(LastRow2))).Select
    Set foundRng = Range(Selection, Intersect(Selection.EntireColumn, Rows(LastRow2))).Find("Parlay")
    'Range("E" & foundRng.Address).Select  'want to select or offset from foundRng address
   
    If foundRng Is Nothing Then
            MsgBox "Value not found"
        Else
            MsgBox foundRng.Address
    End If
   
End Sub



Wagers.xlsm
ABCDEFGH
10#REF!NFLSPRD$ 5.00$ 4.35TB
2#N/ANFLParlay$ 5.00$ 4.00
3#N/A
4#N/A
5
6#REF!Balance
Sheet1
Cell Formulas
RangeFormula
B1B1=#REF!+8-WEEKDAY(#REF!)
A1:A2A1=INDEX('[NFL.xlsm]Weekly Picks'!$D$4:$D$35,MATCH($H1,'[NFL.xlsm]Weekly Picks'!$A$4:$A$35,0))
G3:G4G3=INDEX('[NFL.xlsm]Weekly Picks'!$E$4:$E$35,MATCH($H3,'[NFL.xlsm]Weekly Picks'!$A$4:$A$35,FALSE))
C6C6=#REF!+K5
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
I found the answer: foundRng.Select
 
Upvote 0

Forum statistics

Threads
1,215,038
Messages
6,122,798
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top