vba select foundRng cell

gtd526

Active Member
Joined
Jul 30, 2013
Messages
443
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

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

gtd526

Active Member
Joined
Jul 30, 2013
Messages
443
Office Version
  1. 2019
Platform
  1. Windows
I found the answer: foundRng.Select
 

Forum statistics

Threads
1,143,637
Messages
5,719,969
Members
422,252
Latest member
wannabegeek1

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
Top