Select Cell From Formula

Richard2542

Board Regular
Joined
Apr 27, 2017
Messages
102
Office Version
  1. 365
  2. 2013
Using the cell "address" function, I have identified the cell location (address) of the cell I need to select. I need to write VBA code that uses this returned address to select the corresponding cell.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Welcome to the Board!

Please provide more details, maybe walk us through an actual example, complete with data and formulas.
 
Upvote 0
I used this formula to determine the exact location of the cell I wish to select -
=CELL("address",INDEX(B3:H4,2,MATCH(B2,B3:H3,0)))
The valve returned is:
$D$4

<colgroup><col width="64" style="width:48pt"> </colgroup><tbody>
</tbody>
I now want to go to this location and select it. I will then paste information within this selected cell.
 
Upvote 0
Try this VBA code:
Code:
Sub GoToCell()

    On Error GoTo err_chk
'   Go to cell address being returned by activecell
    Range(ActiveCell.Value).Select
    
    Exit Sub
    
err_chk:
    MsgBox ActiveCell.Value & " is not a valid cell address to go to.", vbOKOnly, "ERROR!"
    
End Sub
It will go whatever cell address is in the ActiveCell at the time you run it.
 
Upvote 0
Try this VBA code:
Code:
Sub GoToCell()

    On Error GoTo err_chk
'   Go to cell address being returned by activecell
    Range(ActiveCell.Value).Select
    
    Exit Sub
    
err_chk:
    MsgBox ActiveCell.Value & " is not a valid cell address to go to.", vbOKOnly, "ERROR!"
    
End Sub
It will go whatever cell address is in the ActiveCell at the time you run it.
Thanks...I'll try this shortly
 
Upvote 0
I used this formula to determine the exact location of the cell I wish to select -
=CELL("address",INDEX(B3:H4,2,MATCH(B2,B3:H3,0)))
The valve returned is:
$D$4

<tbody>
</tbody>
I now want to go to this location and select it. I will then paste information within this selected cell.
This works perfect...thank you so much
 
Upvote 0
You are welcome.
Glad I was able to help!:)
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,424
Members
448,961
Latest member
nzskater

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