Highlight a cell that has a reference on another sheet

dvaladas

New Member
Joined
Nov 30, 2016
Messages
33
Hello,

Is there any chance to highlight a cell that is a reference of another cell?

For example, I have in Sheet1 a cell with the formula =Sheet2'!B1 (the value is 0,001). I need to highlight this value 0,001 on Sheet 2. It is possible?

The goal is know which cells of sheet 2 have a reference on sheet 1.

Thanks
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
One way :-
Code:
Dim sp As Variant
sp = Split([a1].Formula, "!")
Sheets(Mid(sp(0), 2)).Range(sp(1)).Interior.Color = vbYellow
 
Upvote 0
If you have Excel 2013+, you can use the FORMULATEXT function in a Conditional Formatting formula.

If you do not have this function, you can create a UDF for it

Code:
Function FormulaText(rIn as range) as string
FormulaText = rIn.Cells(1).Formula
End Function

Once you have this function, highlight the range that you want to check (i.e. A1:D100) > Conditional Formatting > New Rule > Use a formula

=ISNUMBER(SEARCH("Sheet1",FORMULATEXT(A1)))

Format: Fill color of your choice > OK > OK
 
Upvote 0
One way :-
Code:
Dim sp As Variant
sp = Split([a1].Formula, "!")
Sheets(Mid(sp(0), 2)).Range(sp(1)).Interior.Color = vbYellow

Thanks for the reply but I'm not understanding how can I adapt the code. The thing is I have 50 values on sheet 1 anda my sheet 2 is dynamic and at this time have 50 numbers that are linked to the 50 values of sheet 1.
But I need to know if the next time that I update the sheet 2, which cells of sheets 2 are not linked to sheet 1.

My expected output is highlight the cells of sheet 2 that are linked to the cells of sheet 1. Don't need to be vba, can be a formula too on conditional formatting (if possible).
 
Upvote 0
Thanks for the reply but I'm not understanding how can I adapt the code. The thing is I have 50 values on sheet 1 anda my sheet 2 is dynamic and at this time have 50 numbers that are linked to the 50 values of sheet 1.
But I need to know if the next time that I update the sheet 2, which cells of sheets 2 are not linked to sheet 1.
With Sheet2 active, are you looking for formulas that reference cell only on single specified sheet such as Sheet1? Or are you more generally looking for formulas that reference cells on any of the other sheets in the workbook no matter what sheets those are?
 
Upvote 0
With Sheet2 active, are you looking for formulas that reference cell only on single specified sheet such as Sheet1? Or are you more generally looking for formulas that reference cells on any of the other sheets in the workbook no matter what sheets those are?

Hey Rick,

I just found your code on the thread "VBA to format cell if cell has dependents" and it is perfect to what I nedd!

Thanks!!
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,751
Members
448,989
Latest member
mariah3

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