VBA Text Color

I would like to change the text color to Red for a string being returned to a 
window through vba when certain conditions are met.

I can see the vbRed control but cannot get it to work, Object Required.

Has anyone been able to change the text color through vba, and how is it set?

Mick
0
MickEgan (61)
11/21/2007 5:31:00 AM
greatplains 29623 articles. 2 followers. Follow

2 Replies
664 Views

Similar Articles

[PageSpeed] 46

Hi Mick

I don't believe VBA can directly change the colours on a Dexterity field or 
window.  You can use the unsupported but very useful method of pass through 
Dexterity SanScript to change the colour of the text or the background.

I think you already have the company background colour VBA example.  If you 
want it sent again, email me at the address below (remove the online. first) 
and let me know which version (v8, v9, v10).

David Musgrave [MSFT]
Senior Development Consultant
Escalation Engineer - Great Plains
Microsoft Dynamics Support - Asia Pacific

Microsoft Dynamics (formerly Microsoft Business Solutions)
http://www.microsoft.com/Dynamics

mailto:David.Musgrave@online.microsoft.com

Any views contained within are my personal views and 
not necessarily Microsoft Business Solutions policy.
This posting is provided "AS IS" with no warranties, 
and confers no rights.  


"Mick Egan" wrote:

> I would like to change the text color to Red for a string being returned to a 
> window through vba when certain conditions are met.
> 
> I can see the vbRed control but cannot get it to work, Object Required.
> 
> Has anyone been able to change the text color through vba, and how is it set?
> 
> Mick
0
dmusgrav1 (1325)
11/21/2007 10:31:07 PM
David,

I have the scripts.

Thank-you,

Mick

-- 
Mick


"David Musgrave [MSFT]" wrote:

> Hi Mick
> 
> I don't believe VBA can directly change the colours on a Dexterity field or 
> window.  You can use the unsupported but very useful method of pass through 
> Dexterity SanScript to change the colour of the text or the background.
> 
> I think you already have the company background colour VBA example.  If you 
> want it sent again, email me at the address below (remove the online. first) 
> and let me know which version (v8, v9, v10).
> 
> David Musgrave [MSFT]
> Senior Development Consultant
> Escalation Engineer - Great Plains
> Microsoft Dynamics Support - Asia Pacific
> 
> Microsoft Dynamics (formerly Microsoft Business Solutions)
> http://www.microsoft.com/Dynamics
> 
> mailto:David.Musgrave@online.microsoft.com
> 
> Any views contained within are my personal views and 
> not necessarily Microsoft Business Solutions policy.
> This posting is provided "AS IS" with no warranties, 
> and confers no rights.  
> 
> 
> "Mick Egan" wrote:
> 
> > I would like to change the text color to Red for a string being returned to a 
> > window through vba when certain conditions are met.
> > 
> > I can see the vbRed control but cannot get it to work, Object Required.
> > 
> > Has anyone been able to change the text color through vba, and how is it set?
> > 
> > Mick
0
MickEgan (61)
11/21/2007 11:25:00 PM
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 ...

Group / Ungroup Text Range
Hi - Have a template with a form in Word that is protected with Group (Under Developer ribbon). Also need to show spell check so I'm using Rich Text Boxes. To protect - selected the table they are in and used Group under the Developer ribbon. The user can click on a macro button and generate more of the same rich text boxes. (Kind of like an order form) I had to add font to the boxes because the print was coming out gray instead of black. The problem is I went to add font to the duplicate boxes and an error comes up: "Run-time error 4605. This method or property ...

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...

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 ...

rotate text box
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel How can I rotate a text box or rotate text in a text box? I have a lengthy document (portrait setup) with page numbers in the footer. Works well. However on a few pages I have tables and charts that must be in landscape. When I create a section break to landscape those pages the page numbers move to the right-middle side of the page (if looking at it in portrait). I need to insert a text box, rotate the text, and place the box where the page number should be (bottom of page if viewed in portrait). <br&g...

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'...

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 &...

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...

Manipulating Text between sheets, in a workbook
What I am trying to do is set up a cell where I can type in a name, and then have that name collect under an appropriate field on another worksheet. Then when I type in a different name, into the same cell, it collects that name UNDER the first name on the other worksheet. Would require event code behind the worksheet. Private Sub Worksheet_Change(ByVal Target As Excel.Range) On Error GoTo stoppit Application.EnableEvents = False If Target.Address = "$A$1" And Target.Value <> "" Then Sheets("Sheet2").Cells(Rows.Count, 2).End(xlUp) _ .Offs...

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...

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, > ...

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...

Why doesn't text wrap in a cell in Excel?
I am typing text in a cell and want it to wrap. I checked "wrap text" box however it still doesn't wrap and I can only see part of the text. When I click on the cell the text is there, but I still can't view it if I'm not in that specific cell. Is your cell high enough? Try making your cell hight a bit taller. Excel should automatically adjust the cell height, but that's not always the case. X_HOBBES "rohrbaught" <rohrbaught@discussions.microsoft.com> wrote in message news:ED2C5BEC-FA41-4257-88CB-C348E718A529@microsoft.com... > I am typin...

How to store numbers as Text in Excel
Hi, I would like to store the number (numeric value) such as "123", "456" etc stored in the cells as Text. The formatting of the cell as text is not helping me and if I have to actually convert the data to text then I need to Press F2 and Press Enter again. The methods posted on the web are also not helping me much. I would like to have this solution to a spreadsheet already having numbers stored in them. Thanks in advance. Thanks, Nagaraj I formatted A1 as text. I typed 1234 in it. I put =istext(a1) and it returned true. I hit F2 and enter on cell A1 and the for...

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. >...

Capitalize first letter in text box
Is there a way to capitalize the first letter entered into a text box, such as a field that would ask for a Name? <setabery@hotmail.com> wrote in message news:1179147166.403763.312140@o5g2000hsb.googlegroups.com... > Is there a way to capitalize the first letter entered into a text box, > such as a field that would ask for a Name? This should work for you. Substitute your textbox name for Text0: Private Sub Text0_KeyUp(KeyCode As Integer, Shift As Integer) ' Changes first character in a text box to Sentence Case ' Arvin Meyer 4/30/1999 On Error GoTo Err_Text0 If Len(Me...

VBA Customization
Is there a way to get the name of the current company through VBA in Great Plains 8.0? Thanks for all your help. open GreatPlains. Add the current window, it will add the Toolbar then add fields choose the company name on the top left after the user id. >-----Original Message----- >Is there a way to get the name of the current company through VBA in Great >Plains 8.0? > >Thanks for all your help. > > > >. > Thanks. I tried, but I couldn't add company name to the field list. It opens up the login screen instead. Any thoughts? Thanks again. "ger...

How to Read typed text
Hello, I am using CFileDialog class to save a specific file. I was wondering, is there a way to use CFileDialog to read in a text character by character when they type in a file they want to save? I have a CEdit dialog that displays the name of saved file, but I was wondering if its possible to use CFileDialog to transfer character-by-character to CEdit as user is typing text. Hope to hear some comments on this. Thank you, Victor. Your question is not very clear. Exactly what is being typed in? Certainly not the content of the file... joe On Mon, 26 Sep 2005 10:40:02 -0700, &...

Run VBA without show
I want excel to run the VBA code without showing me what it is doing. Which code should i use for that? Sub RunWithoutShow() Application.ScreenUpdating = False 'Paste the vba code here 'end of code 'Change screenupdating property to true Application.ScreenUpdating = True End Sub I hope this helps... Selva V Pasupathy For more on Excel, VBA, & other Resources Please visit: http://socko.wordpress.com You may also (inserting into quote from code example bellow from Socko) Use Application.Visible property to hide the application entirely Sub RunWithoutShow() Appli...

Form Controls vs VBA controls
I am new to VBA so just finding my feet, can anyone help me with th differences between an excel control (i.e. one from the form toolbox lets say a checkBox and a vba checkBox? From trying the two controls the I have noticed is that you canno capture the change event of the VBA checkbox in the code module, it ha to be done via the sheet (i.e. checkbox on sheet1, code goes in chang event on sheet1) the control is placed on, is this correct? What woul you do if you have three sheets with the same controls just differen data, do you really have to code the control 3 times? The excel control ho...

Spacing around text
I have a column of cells containing text. The amount of text varies. I enter it with word wrap, so the height of each cell adjusts to fit the text. Therein lies the problem. The text fills the cell from top to bottom. When I print the column, it looks like a single column of text. How can I add some spacing around each block of text so that each is visually distinct in the printed result? I tried adding borders, but that just adds clutter. I don't want to manually resize the cells because I may have as many as 25,000 entered over a period of months. I don't want to have to resize it...

Referencing a ComboBox in VBA
Hi, I am using Excel 2007. I want to run some code in my Workbook_Open() Sub that fills a combo box on one of my Worksheets (I will call it myCombo on mySheet). I tried the following code and it did not work: myCombo.Clear myCombo.AddItem "Item One" myCombo.AddItem "Item Two" myCombo.AddItem "Item Three" I assume that the problem is that within the Workbook_Open() Sub, the reference to myCombo is not valid. Can anyone tell me if/how I can get a valid reference to myCombo (on mySheet)? Thanks in advance, Paul Kraemer -- Paul Krae...

inserting and renaming a sheet vba
Instead of having 2 lines of code, one to insert a new sheet and one t rename it, is there a way to insert a sheet with particular name i one go -- Matt Housto ----------------------------------------------------------------------- Matt Houston's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=451 View this thread: http://www.excelforum.com/showthread.php?threadid=26717 ...

color-coding cells and more
Excel 97 / W98 Two easy questions. Is there a way to color-code a cell based on a condition, BUT not using Visual Basic Editor? That is, I want to change a cell based on a condition using the =IF(a,b,c) format. In the status bar, I have choices of SUM, Average, and a few others. Always opens with SUM as the default option. Can I change the default to 'Average?' -- Replace the AT in address Statistics convinces us we are in a minority. Probability convinces us we are psychic. Old guy wrote: > Is there a way to color-code a cell based on a condition, BUT not > ...

Text running
Hello I don't know if there is a code that keeps a word ( for example FOOTBALL) running from left to the right of the cell. I appriciate even a small help. Thanks in advance Where would you like it to run to? English and most other languages run left to right. Middle East countries usually run right to left. There are various methods of text alignment in cell formatting>alignment. Gord Dibben MS Excel MVP On Thu, 15 Apr 2010 09:39:01 -0700, MAX <MAX@discussions.microsoft.com> wrote: >Hello >I don't know if there is a code that keeps a wor...