LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #12   Report Post  
Bob Phillips
 
Posts: n/a
Default

You are not taking Steve's advice and using Conditional Formatting.

I don't understand why you are getting the first problem. but the second
would be addressed by conditional formatting. Otherwise, you just run the
essence of that code on all of the cells in the usedrange.

But conditional formatting is better.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"dave m" wrote in message
...
OK Stevie,Bob,
Thanks for your help so far.
Now i have the module loaded which and have applied the cf. However it
doesn't seem to work they way I need.
I tried the first function
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$A$1" Then
If Target.HasFormula Then
Target.Interior.Color = RGB(255, 0, 0)
Else
Target.Interior.Color = RGB(0, 255, 0)
End If
End If
End Sub
and it worked to a point for 1 cell.
I removed the line
If Target.Address = "$A$1" Then
and the corresponding "end if" and it applied the function to the whole
worksheet, not just the columns i need.
The other thing is that this function only takes effect as a cell is
changed, and it would be better if it could apply to predefined
formulas/values already in cells.
So
1. Can I apply the above so it will only work on the specific

cells/columns
without having to copy the function for each cell.
2. Can it then be applied to predetermined Values/formulas in the cells.
If you need further info re the intricacies of this worksheet, and the
reason for my needs. please email me
I look forward to your reply and your assistance.
Thanks.
Dave.
"Stevie_mac" wrote:

There is a better way that will solve all your problems...

* Open VB (Alt+F11)
* Add a Module
* Paste the following function into the new module
Public Function HasFormula(target As Range) As Boolean
HasFormula = target.HasFormula()
End Function

Now you can use conditional formatting
Example...
Select cell B1
Open Conditional Formatting
In Condition1, select [Formula Is]
Enter =HasFormula(A1) as the condition
Set the format to make the cell RED & close Conditional

Formatting
Test...
Enter =10/5 into Cell A1
See B1 go red
Enter "hello" into Cell A1
See formatting clear.

Good luck - Steve.



"dave m" wrote in message

...
Hey Stevie,
@nd formula in vb works fine on single cell, If i clear the cell line

in vb
it dont work at all.
What would be great is if you can detail how to do a columnSame cell

Ref) in
many sheets.
Look forward to yr reply.

D.

"dave m" wrote:

Hello all,
I have a complex w/sheet with daily sheets that runs a vlookup based

on data
entered. once vlookup cells are populated with values, i copy,paste

special
values to force the values into cells at the time of lookup.This

prevents
data lookups showing old values on future days. Can i con.format

cells so
that if they are vlookups they are 1 colour and another colour if

values. I
have tried various formulas with no success and also tried

referencing the
data elsewhere with no success. A curly one for frank, bob and max

here me
thinks. Look forward to yr assistance as always.

Thanks, David.






 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
cell contents Kevin Excel Discussion (Misc queries) 1 March 8th 05 11:23 AM
Formula to return cell contents based on multiple conditions Bill Excel Worksheet Functions 3 January 19th 05 09:59 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM
Returning a Value to a Cell Based on a Range of Uncertain Size amc422 Excel Worksheet Functions 7 November 14th 04 03:03 PM
Modify Row & Cell Contents based upon Cells Values bpat1434 Excel Worksheet Functions 1 November 7th 04 12:43 PM


All times are GMT +1. The time now is 11:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"