VBA conditional formatting

Hi there,

I have read up about conditional formatting and understand the *concept* 
clearly (I think). However, is it possible to display conditional formatting 
of a subform in datasheet view on a form? If so, can someone please help me 
with the VBA coding of this, as I need to have more than 3 (or 4 if default 
is used) colours?

Thank you!
W
-- 
The Psyber Fox
http://www.psyberconsulting.co.za
0
Utf
6/4/2010 9:36:31 AM
access 16762 articles. 2 followers. Follow

2 Replies
1988 Views

Similar Articles

[PageSpeed] 27

If you use VBA code to set the properties of the controls (ForColor etc), it 
will affect all rows of the datasheet, so no: that's not possible.

You can use that approach in a report: that's probably your only option if 
you need more than 3 formats.

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"PsyberFox" <PsyberFox@discussions.microsoft.com> wrote in message 
news:9BDFFD9C-52AB-41AB-B7BE-A54ABE016452@microsoft.com...
> Hi there,
>
> I have read up about conditional formatting and understand the *concept*
> clearly (I think). However, is it possible to display conditional 
> formatting
> of a subform in datasheet view on a form? If so, can someone please help 
> me
> with the VBA coding of this, as I need to have more than 3 (or 4 if 
> default
> is used) colours?
 

0
Allen
6/4/2010 9:48:07 AM
Thank you for the info...
-- 
The Psyber Fox
http://www.psyberconsulting.co.za


"Allen Browne" wrote:

> If you use VBA code to set the properties of the controls (ForColor etc), it 
> will affect all rows of the datasheet, so no: that's not possible.
> 
> You can use that approach in a report: that's probably your only option if 
> you need more than 3 formats.
> 
> -- 
> Allen Browne - Microsoft MVP.  Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
> 
> 
> "PsyberFox" <PsyberFox@discussions.microsoft.com> wrote in message 
> news:9BDFFD9C-52AB-41AB-B7BE-A54ABE016452@microsoft.com...
> > Hi there,
> >
> > I have read up about conditional formatting and understand the *concept*
> > clearly (I think). However, is it possible to display conditional 
> > formatting
> > of a subform in datasheet view on a form? If so, can someone please help 
> > me
> > with the VBA coding of this, as I need to have more than 3 (or 4 if 
> > default
> > is used) colours?
>  
> 
> .
> 
0
Utf
6/4/2010 11:35:15 AM
Reply:

Similar Artilces:

VBA code to say Yes or No if any VBA code is present in ActiveWork
Using XL 2003 & 97 Would like hit Ctrl+Shift+V and have an answer either yes or no as to the presence of Any VBA code in the Active Workbook. I do know that about the VBA editor/Explorer or to press the Run Macro button and get a list from various sources . I would like to stay at the keyboard and process a series of macros including one to let me know if I even need to evoke the VBA explorer. TIA Dennis There is no bootstrap macro to tell you whether you have macros or not. If there were there would be no limit to virus writers. --- HTH, David McRitchie, Microsoft MVP - Excel ...

Date Format / Pivot Table Grouping
Hi Folks: I've imported 4,000+ records from a Filemaker database. About 70% of the dates come in formatted as mo/da/yr and are right justifed About 30% come in as yr/mo/da and are left justifed Setting up a pivot table, I'm not able to do a year group (I guess becasue of the dating) I'm not able to change the format of the 30% Is there a way to change yr/mo/da to mo/da/yr - or any other suggestions ?? Many thanks Steve Sort the dates and the yr/mo/da entries should be grouped at the bottom of the list. Select the yr/mo/da entries Choose Data>Text to Columns Click Next, N...

Nested IF Conditions
Hello All Gurus, I am using Windows XP/Office 2003 and have the following problem: I have a worksheet with 9 Columns as follows: A B C D E F G H I Code Shift Work From To OTfrom upto Normal Extra A xxx xxx xxx xx xxx xx (blank) (blank) S xxx xxx xxx xx xxx xx (blank) (blank) M xxx xxx xxx xx xxx xx 9 (blank) H xxx xxx xxx xx xxx xx 9 (blank) (Blank)xxx xx xxx xx xxx xx 9 3 Codes used are as follows: A = Absent S = Sunda...

Use VBA to update Access table or Query from Excel
Can I use VBA to update Access table or Query from Excel? Thanks in advance Hi Leungkong, > Can I use VBA to update Access table or Query from Excel? Of course, using ADO or DAO. See: http://www.erlandsendata.no/english/index.php?d=envbadacexportado Regards, Jan Karel Pieterse Excel MVP http://www.jkp-ads.com Hi Jan, Thanks. I think ADO is what I want. But I am not only want to export from excel to access. I want to edit some data in access table. For example, Access has a table "ProductList" I want to use Excel to call the product by "Pro...

match based on 2 conditions
i am trying to match a verb from a column on a worksheet to the same verb in a column on a different sheet but only if the verb is being used (which is indicated by a "Yes" in the verb's adjacent column). Then, where the verbs match, I need the value of the fourth column on the same row where the "Yes" and matched verb are. So far I have is this formula: =IF(INDEX(Verbs!B:B,(MATCH(M4,Verbs!C:C,1)))="Yes",(VLOOKUP(M4,Verbs!C:G,4))," ") while it works in most cases, there are some cases where the verb exists more than one time...

Print, Merged Cells, and VBA
Hello I'm looking for a code that will help me with a print job for a worksheet. There are a lot of merged cells and a lot of "IF"s to be used in the VBA for range selection. Thanks in advance, Sarr ...

POS Receipt format change
I would like to have the "Sales Receipt" read "Sales Invoice" or "Invoice". Also I would like to have "Transaction #" replaced with "Invoice #". Can anyone help me with this? I have been able to edit the "Sales Receipt" portion in an xml editor but have not been able to change the "Transaction #" as there must be some other coding that needs to change. Thank you in advance. Robert Hi Robert, you can find the SUB: PrintTransactionType and then locate the Transaction.ReceiptReferenceNumberCaption reference field. this...

Three condition "if" statements
I'm trying to write an IF statement that needs to look at the input of three cells (D4, D5 and D6). If any of them are "YES" then I need cell E4 to = cell G1. However, If they are all "no" then I need cell E4 to = cell G2 Finally, if they are all blank then I need cell e4 to be blank Also, if I do this can I conditionally format cell E4 so if it = G1 then it is White text on a red background, and if it = G2 then it is Black text on a green background (I'm okay with CF just need to know if it's possible) Looking forward to your replies. ...

Excel 2002 annoyance
Greetings List I am using Excel XP amd Access XP I regularly run queries in Access and cut and paste the results into a new Excel spreadsheet. The Access data is usually formatted numeric, fixed, zero decimal places. Once pasted into Excel, it gains 2 decimal places and I get the little green triangle in each cell inviting me to convert to numeric of error check etc. Can anyone think of a way to retain the numeric formatting from the MS Access data? Regards George ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet mess...

wav file format
Hello, I am trying to write a *.wav file. I read about its format and now I can write a *.wav file but when I am trying to play it with Media player, it reports that the file is corrupted which I think means that there is a problem on the file format but I couldn't find what is it. Is there any application that could read a wav file and report if there is any problem in its format? Is there any code that helps me to find what I can use to write a wav file? Any help is very appreciated. Best regards Have you seen www.wotsit.org? "ma" <ma@nowhere.com> wrote i...

Conditional Formatting Need
Please Help, I really tried on my own. Column A and Column B If the cell value in column A1 is <6 format should be Blank If it is 6.0-6.99 then it will look to B1 for more info If it is 7-0-7.99 then it will look to B1 for more info And if it is 8 or greater it will look to B1 for more info If A1�s value is 6 or greater it is possible it will still remai blank, but now it will look to B1 for that value, to determine wha should happen with A1 If B1 is greater than 2.99 then A1 will remain blank and also B1 wil be blank If B1 is between 2.0 and 2.99 and A1 is between 6 and 7.99 the forma...

VBA and Scheduled task in Outlook
Hi, how can I: a) pull the query from somewhere and send it by e-mail automatically. E.g. I want to take a temperature table from http://www.wunderground.com/history/airport/EHAM/2009/7/10/DailyHistory.html?req_city=NA&req_state=NA&req_statename=NA where 2009/7/10 is the date of yesterday put it into an e-mail and send it automatically each day at 8 o'clock? b) if this is not possible, how can I send an e-mail with the attachment c:\Documents\query20090710.xls each day at 8 o'clock? my boss wants this automatized, I know how to write the VBA code for Excel, but don'...

VLOOKUP in VBA
On the worksheet I can insert in a cell =VLOOKUP(C5, Hobokee.xls!AcsLow, 2) and it works perfectly, looks up the value in column 2 of the range named AcsLow in the same workbook. But elswhere I want in a macro to lookup the same table and assign the result to a variable BalAmt. BalAmt = VLOOKUP(AccNum, Hobokee.xls!AcsLow, 2) does not work. It gives a function not defined error on Hobokee. If instead of Hobokee I put Workbooks("Hobokee"), it gives function not defined error for VLOOKUP which it changes to VLookup. I have been overVLOOKUP in the Help file and see nothing wrong. W...

Column width and pasting sections in excel? Formatting questions
I am trying to make a spreadsheet in which I need to have varied column widths in different sections, one under another. (they don't need to relate directly, and no major equations going on) for example: xxxxxxxxx|xxxxxxxxxx xxxxxxxxx|xxxxxxxxxx xxxxxxxxx|xxxxxxxxxx xxxxxxx|xxxxx|xxxxxx xxxxxxx|xxxxx|xxxxxx How do I go about splitting the sheet or whatever I need to do so I can manipulate columns differently based on the row I'm in? Thanks! Rich Column widths apply to the whole column. You may be able to use merged cells to give the appearance that you want, but I try to stay...

vba select field
Hi, having a button on a form, is it possible to select only some fields (all from the same table) of the current record instead of all fields? I've tried this code: RunCommand acCmdSelectRecord RunCommand acCmdCopy Forse dipende dei dati nel record. but it selects ALL fields in the form. Thank you. Remigio hi, On 10.04.2010 18:01, remigio wrote: > having a button on a form, is it possible to select only some fields > (all from the same table) of the current record instead of all fields? > I've tried this code: > > RunCommand acCmdSelectRecord &...

Turn pc speaker on/off with vba code
Is this possible? Thanks I found something here on how to do it withVBScript. You can probably modify it to work in VBA http://www.pcreview.co.uk/forums/thread-1468591.php -- HTH, Barb Reinhardt "David" wrote: > Is this possible? > Thanks Thanks Barb I'll have a go (I need to improve my web searching skills) "Barb Reinhardt" wrote: > I found something here on how to do it withVBScript. You can probably modify > it to work in VBA > > http://www.pcreview.co.uk/forums/thread-1468591.php > -- > HTH, > ...

Number Format #10
Hello I've got a large spreadsheet which was imported. Apart from the first 2 columns, the rows consist of number which I need to filter, but this isn't working. Then I noticed an apostrophe before each number in every cell, which doesn't show in the cell but up in the formula/text bar. I've set all the columns to numbers but the apostrophe won't go away. Please can someone tell me how I can without having to go into each cell as there are hundreds. Thank you J Select all the columns with these "numbers" in them, then right click the tab at the bottom of t...

Excel VBA/Macro programming for beginners
Hi all, I know a bit VB 6.0 programming. Will it help me to write exce vba/macro(same thing?).can anybody help me by providing some fre websites where i can have informations/codes for VBA/macro. Please tell me how could i make a *command Button * in a cell in th excel sheet -- sdebu_200 ----------------------------------------------------------------------- sdebu_2000's Profile: http://www.officehelp.in/member.php?userid=430 View this thread: http://www.officehelp.in/showthread.php?t=118812 Posted from - http://www.officehelp.i Try David McRitchie's "getting started with mac...

Formatting Worksheet Rows
Is it possible to format every other row to be shaded - then when adding a row in the middle of the document it would reset the all rows following to reset to every other row being white and every other row shaded > Is it possible to format every other row to be shaded - > then when adding a row in the middle of the document it > would reset the all rows following to reset to every other > row being white and every other row shaded If I understand the requirement correctly, one way would be to use Format >> Conditional formatting with the formula condition =MOD(...

Conditional Formatting #65
I have a date cell that I need to apply conditional formatting to when the date is now one year later. Example: A4 contains the date 1/1/2007 and today's date is in cell F2 with the formula [TODAY()]. If cell A4 is one year in the past I'd like the font to change so I'll know that date is older than one year from today's date. Thanks for any help! Trish On Apr 10, 9:43=A0am, Trish <trish....@gmail.com> wrote: > I have a date cell that I need to apply conditional formatting to when > the date is now one year later. > > Example: A4 contains the date 1/1/2007 ...

Built-in Number Format "#,##0_);(#,##0)"
I want to display my negative numbers in parentheses and should be able to use one of the built-in number formats. I select (Format > Cells)(Number tab) and in the category listbox, select "Number". The last two items in the Negative numbers listbox do not have parentheses. The built-in number format that should contain parentheses, "#,##0_);(#,##0)" has actually changed to "#,##0_);(#,##0)" Has anyone seen this before ? I could create a custom number format but this should be built-in. Hi James! You'll get the last two number options to include ()...

Loading a Form from VBA
Hi all, I'd like a module to open and load a form in my Access 2003 database... How can I do this? Use the OpenForm method. Look in the Help file for details. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Mike" <michael.leon.schwartz@gmail.com> wrote in message news:1184770076.109526.207900@o11g2000prd.googlegroups.com... > Hi all, I'd like a module to open and load a form in my Access 2003 > database... How can I do this? > On Jul 18, 10:58 am, "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com&g...

Cell Shading > 3 conditions
I have a spreadsheet that contains up to 6 different text strings. I'd like to automatically change the text color or the cell shading depending on the specific condition. For example, if the cell contains "A", make the cell shading red. If it contains "B", change the font color to red. Excel's conditional formatting limits me to 3 conditions. How can I accomplish this objective? I'm using Office 98 on a Mac, and worse, I'm not VBA smart. Thanks. rick -- rabsparks ------------------------------------------------------------------------ rabsparks's ...

Excel and VBA
I am very interested in learning more about using VBA in office, especially Excel. Can you post some resources (online, books, etc) that can be used to help learn about using Visual Basic in office. Thanks! Here's a good place to start: http://www.contextures.com/xlbooks.html Does that help? *********** Regards, Ron XL2002, WinXP "Bob Sinclair" wrote: > I am very interested in learning more about using VBA in office, especially > Excel. Can you post some resources (online, books, etc) that can be used to > help learn about using Visual Basic in office. >...

Multiple Formula Custom Formatting
I was recently challenged to create a formula that displays two values separated by a slash in the same cell. For example A1=40 and B2= 10. C3 displays [30 / .75]. The difference between the two, and what should be the percentage. The formula I put together is =(A1-B2)&" / "&((A1-B2)/A1). The formula works but I can not get the second value to format as a %, it only displays as a decimal. Does anyone know how I can make the second value display as a percentage without messing up the formatting of the first value? Any advice would be much appreciated. ...