[AccessD] WAY OT:Excel Formatting Q

Mcgillivray, Don [IT] Donald.A.McGillivray at sprint.com
Mon Nov 28 16:01:20 CST 2005


Darren,

Try using Excel's conditional formatting.  It allows only three
conditions to be tested, but should work for this.

Don

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK
Sent: Monday, November 28, 2005 1:50 PM
To: accessd at databaseadvisors.com
Subject: [AccessD] WAY OT:Excel Formatting Q


Hi all
I apologise for the OT
So feel free to respond to my personal email if you wish

I am setting up an excel document that has a column that records
pass/fail/not tested - Only 1 of 3 possibilities
What I want is the default to be "Not tested" and the backcolour of that
cell to be say...orange
The...
If a user types F or Fail or fail I want the backcolour to go red 
If a user types P or Pass or pass I want the backcolour to go green


In access I would write a function something like this

F_SetBackColour(strControlName as string, strControlValue as string)

	select case strControlValue
	
	Case "F" or "fail" or "fail"
		Forms!someForm(strControlName).backcolor = 255
	Case "P" or "Pass" or "pass"
		Forms!someForm(strControlName).backcolor = vbGreen
	Case Else
		Forms!someForm(strControlName).backcolor = vbOrange
	end select
End function

And in the after update of each relevant control I would have something
like

Private sub SomeControl_AfterUpdate()

F_SetBackColour(me.currentControl, me.currentControl.value)

End sub

To achieve this in Excel what would I have to do?

Many thanks in advance

Darren

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list