format cells depending on formula

Corticus

Well-known Member
Joined
Apr 30, 2002
Messages
1,579
Hi all,

Can I conditionally format cells depending on the formula contained.<elaboration>
I have a sheet that consists of nothing but references.
No data input.
I would like to highlight the cells that refer to sheets other than the one I'm looking at.
That way, I can make the sheet "stand-alone" in that the other sheets will no longer be required for data entry.
All references to other sheets can be replaced with blank cells.</elaboration>

I know the Ctrl~ thing, but its a BIG sheet, and conditional formatting (or VBA, I guess) would really help speed up the process, as well as make for interesting analysis of future sheets that need similar work.

Fruitful and Abundant Thanks!
Corticus
This message was edited by Corticus on 2002-08-23 06:39
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Corticus,

I was unable to find anyway to do it without VBA. VBA has a HASFORMULA function that you could use to change the color of the cell:


HasFormula Property Example

This example prompts the user to select a range on Sheet1. If every cell in the selected range contains a formula, the example displays a message.

Worksheets("Sheet1").Activate
Set rr = Application.InputBox( _
prompt:="Select a range on this worksheet", _
Type:=8)
If rr.HasFormula = True Then
MsgBox "Every cell in the selection contains a formula"
End If
 
Upvote 0
If you delete (from a copy) the other sheets, then the cells referencing that sheet should show "#REF!" (just tried a simple experiment.)

It won't automatically blank those cells, but you should at least see all the cells quickly.
 
Upvote 0
Thanks for the help!

Chimp: It was the #Ref that got me to posting this initially :smile:

I'm in the process of revising some severly overcomplicated unit-cost-methodolgy(not that you cared), and in the process, I've been deleteing pages of data-entry, thus the #Ref.

I was hoping for a way to identify the cells that would give me #Ref so I could fix them before they went batty.

I figured, if the formula says Sum('Sheet1'!A1:A20) that I could find all the formulas with 'Sheet1', and fix em.

I would do find and replace, but its not a consitent replace.

Anyways, sorry to ramble, thanks for the help!

Peace and Blessings,
Corticus
 
Upvote 0

Forum statistics

Threads
1,222,095
Messages
6,163,904
Members
451,865
Latest member
dunworthc

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