vba select cell with same value as another cell

bluefeather8989

Active Member
Joined
Nov 20, 2009
Messages
325
Office Version
  1. 365
Platform
  1. Windows
I need a macro to select the value in sheets (Score F6:F51) that matches the same number from sheets (Scoreboard AA10).
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Code:
MsgBox Sheets("Sheet1").Range("F6:F51").Find(Sheets("Sheet2").Range("AA10"), , , 1).Address
 
Upvote 0
Code:
MsgBox Sheets("Sheet1").Range("F6:F51").Find(Sheets("Sheet2").Range("AA10"), , , 1).Address
I'm sorry it was very late when i wrote this but i need it to select the cell not the address. can you plz rewrite this?
 
Upvote 0
VBA Code:
Application.Goto Sheets("Sheet1").Range("F6:F51").Find(Sheets("Sheet2").Range("AA10"), Sheets("Sheet1").Range("F51"), , 1), True

Please note it will error if the search term isn't in the range
 
Upvote 0
VBA Code:
Application.Goto Sheets("Sheet1").Range("F6:F51").Find(Sheets("Sheet2").Range("AA10"), Sheets("Sheet1").Range("F51"), , 1), True

Please note it will error if the search term isn't in the range
For futre referenc this code will only work if Sheets("Sheet1") is selected. I had to add Sheets("Sheet1").Select code above this code. It works fine for me. (y) :)
 
Upvote 0
For futre referenc this code will only work if Sheets("Sheet1") is selected. I had to add Sheets("Sheet1").Select code above this code. It works fine for me. (y) :)
The sheet does NOT need selecting for that code (it needs no selecting of the sheet or the cell, it goes there as is), if are using Select then the sheet does need activating/selecting so just

VBA Code:
Sheets("Sheet1").Activate
Range("F6:F51").Find(Sheets("Sheet2").Range("AA10"), Range("F51"), , 1).Select
 
Last edited:
Upvote 0
Solution

Forum statistics

Threads
1,215,262
Messages
6,123,938
Members
449,134
Latest member
NickWBA

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