Use Macro to Format UserForm Object

I have a UserForm with dozens of textboxes on it.  I periodically need to 
change the formatting of the textboxes and I been trying to write a macro to 
do it to no avail.  Here' what I thought would work but it doesn't.  HELP 
PLEASE.  THANKS

Sub ChangeFonts_Click()
    Dim Boxes As Long
    With editForm
      For Boxes = 1 To 78
        ("TextBox" & Boxes).font
        .Name = "Arial"
        .FontStyle = "Bold"
        .Size = 10
      Next
    End With
End Sub
0
Utf
1/7/2010 5:43:01 PM
excel.programming 6508 articles. 2 followers. Follow

1 Replies
794 Views

Similar Articles

[PageSpeed] 51

Try this code instead and see if it does what you want...

Sub ChangeFonts_Click()
  Dim C As Control
  For Each C In editForm.Controls
    If TypeOf C Is msforms.TextBox Then
      With C.Font
        .Name = "Arial"
        .Size = 10
        .Bold = True
      End With
    End If
  Next
End Sub

-- 
Rick (MVP - Excel)


"RussellT" <RussellT@discussions.microsoft.com> wrote in message 
news:005C968D-E246-4DEF-8BCA-BDCC5C7F208E@microsoft.com...
>I have a UserForm with dozens of textboxes on it.  I periodically need to
> change the formatting of the textboxes and I been trying to write a macro 
> to
> do it to no avail.  Here' what I thought would work but it doesn't.  HELP
> PLEASE.  THANKS
>
> Sub ChangeFonts_Click()
>    Dim Boxes As Long
>    With editForm
>      For Boxes = 1 To 78
>        ("TextBox" & Boxes).font
>        .Name = "Arial"
>        .FontStyle = "Bold"
>        .Size = 10
>      Next
>    End With
> End Sub 

0
Rick
1/7/2010 5:55:51 PM
Reply:

Similar Artilces:

The receipt format is totally different from the preview
My printer is EPSON TM88III and I installed the OPOS driver. The receipt printed has a different font and layout from the one in the receipt preview, e.g., in the preview the "Sales Receipt" is in a white box with black border while in the receipt it is in a black box. How can I solve this problem? Thank you! -- Nothing Is this all because of the OPOS driver? -- Nothing "NothingMuch" wrote: > My printer is EPSON TM88III and I installed the OPOS driver. The receipt > printed has a different font and layout from the one in the receipt preview, > e.g., in...

Font & Format Issue
Hi, what I am looking for is when I recieve e-mail, I would like to be able to read it in the font of my choosing (my default font) but I end up getting different fonts and also when I print them out they are not what I have set up as my default. Did i miss a step? ...

Formatting suddenly showing up in my signature, help?
I've been using the same signature on my emails for years and yesterday they suddenly show up with formatting (paragraph marks, etc). I must have hit something? But don't know what and I can't get rid of it. Using html for signature. Thanks. Ctrl+Shift+8 toggles the formatting marks off and on. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com/ Outlook Tips by email: mailto:dailytips-subscribe-request@lists.outlooktips.net EMO - a weekly newsletter about Outlook and E...

Outlook lockup during spellcheck using HTML
This is a problem I have seen to some extent on a few different computers. Current configuration: Win 2000 pro - Fully patched Office 2000 -- Fully patched When I get an E-mail that is using HTML format and I reply <send> (Outlook attempts to start spell check) Outlook locks up. Its puts my CPU usage to 80-90% and appears to go into a loop. Sometimes it will pop out in 15-20 seconds, otherwise it will never come out. ...

Automatic log-on to web site using hyperlink
Is there any way that I can use a hyperlink function and include my log-in name and password so that I can automatically log on to a website? If so, is it then possible to pass other parameters so that, for example, I might automatically choose option 2 from 4 options, or choose from a list of dates which are later than a particular date (I'm thinking here of a list of invoices, and I just want the last few)? Pete ...

Delivery report format in Exchange 2003
We have recently installed an Exchange 2003 server to replace an Exchange 2000 system. Everything seems to work fine except for delivery reports. In the Exchange 2000 system delivery reports were coming back with the original subject appended to the subject. This is no longer the case i.e. the reports are coming back with a subject header 'Delivered' but with the original subject header information. Does anybody have any idea why this would be ...

Text quote marks in Macro
If have a macro which is to replace a formula in a cell where the operator has the option of either accepting the formula result as a default or overtyping with a different value. A "Reset" button runs the macro that restores the formula into the cell. The line that does this is .. Range("New_Sec") = "=If(Purpose_1="Upstamp",0,1)" The obvious problem is that the Macro needs to see the formula as a string so that it can be put back into the cell, so it is enclosed in quotes, and the formula needs to have "Upstamp" defined as a string, so ...

Finding MDB or XLS files that contain macros
As part of our future conversion to XP and office 2003, we will be converting thousands of mdb and XLS files. We want to first identify/test those that contain macros. Is there a simple utility/app out there that can do a directory search of files, and identify which ones have macros? ...

Business Objects and Excel
I have a Business Object Report that outputs to an Excel spreadsheet. I want to format the spreadsheet and save it before sending it out to users. The problem I have is that when I finish with the formatting, I cannot close the Excel Application. It also asks me if I want to save the file, when I go the the Excel Application. Below is the code I am using. Could anybody olease help? Sub EmailReport() On Error GoTo Emsg Dim doc As Document Dim body As String Dim ReportName As String Dim locPath As String Dim objExcel As Object Dim myObjExcel As Excel.Worksheet Dim myObjWorkBoo...

Macro use in different location
I create a macro (excel 2003)-security low or medium- in one location and then when I try to run the macro in another location it just goes back and repeats itself in the original location. How do I get the macro to be independent of the originial creation location? Hi post your code :-) -- Regards Frank Kabel Frankfurt, Germany "dersu" <dersu@discussions.microsoft.com> schrieb im Newsbeitrag news:44B1AE50-F5C5-4249-BBD5-D15FFE0AF7B4@microsoft.com... > I create a macro (excel 2003)-security low or medium- in one location and > then when I try to run the macro in an...

Recipient policy change or use admodify
Hi, We have to change the email addresses of ALL our users to firstname.lastname@newdomain.com A couple of questions: 1) Should I use recipient policy and then choose update this policy or use admodify to add this email address 2) Should I just use the default policy and enter %s.%g@newdomain.com and set it as primary or add a custom policy with this entered? 3) Are there any advantages in creating another recipient policy to achieve the above? Many thanks in advance. Option 2 - add the new domain in default policy and set it as default. Keep the old addresses around (as secondary addre...

Conditional Formatting
I have a spreadsheet date formatted cell(s). I would like to have users apply a bold font (or some other formatting change)to that cell to indicate if the date has been met. Can I use conditional formatting to sense that change in condition, and use it to drive conditonal formatting in another cell through some more conventional application? A traditional way might be to track start and complete dates, and compare the two. However, I am looking for techniques to condense the spreadsheet. Maybe you could have the user put something in a column in the same row (an X in column A???). Then u...

OL2003 will not use default email account for sending emails
I have copied the following from an earlier message within this group. A recommendation was posted, but did not help the original poster nor myself in resolving the issue. I have noticed this problem within the past 24 hours and can not overcome. Here is the original post from a couple months ago: :>I am running Office Pro 2003 SP1 :> :>I have read several postings and accept that Outlook will reply to :>mails via the account the was received from. However, i have added a :>new account and set it as default, but mail still gets sent from my :>other account. :> :>This...

outlook 97 "Cannot load library LXBCPRP.DLL default used." error .
when i print from outlook 97 I rec the message "Cannot load library LXBCPRP.DLL default used. Error 126 need to click ok 3 or 4 times to print. Lexmark printer? try reinstalling the drivers. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Outlook Tips by email: dailytips-subscribe-request@lists.outlooktips.net Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Subscribe to...

Using Givex Card in place of actual money back
Is anyone else out there using Givex Card for this purpose in RMS? Our business is setup as a non-profit organization with no refund after the purchase process. Since, we started the Givex gift card program my management has raise the question of using the Givex gift card as a means for allowing the stores to do refund back to a Givex gift card. From Givex Support: "If a customer comes in wanted to do a return rather than returning cash you can put that amount (return) on the gift card which means the store won't loose any funds which have already been collected and you gu...

Text Formating #3
I have a spreadsheet where 1 column = firstname and initial. For example Dave C. How can I mask the cell to be just the first name? Thanks Ben Yes, using a formula like this =MID(D7,1,FIND(" ",D7,1)-1) where D7 contains the name in question. This formula returns everything before the first blank space in the entry- which is great until you run into Mary Ann X, who gets converted to Mary. You da man, thank you It works! But.....I get a #VALUE! if the name does not have a firstname and initial, can you help? Sorry for the delayed response- try this: =IF(ISNUMBER(FIND(&quo...

Use combo to display record on subform?
I am fine with using a combo to find a record on a form, and display all the details about the chosen record in a number of controls. But the very same design doesn't work if it is all on a subform on a tab page. I can select the value in the combo (the name, for example) but the address data doesn't pull through into the address controls. How can I achieve this? Many thanks CW CW, CW wrote: > But the very same design doesn't work ... What "very same design" is that? Can you give a bit more detail about what and how you are doing this please? -- Steve Schapel...

Adding data labels to plotted quadrant (using Peltier solution)
Hi all, I was able to find Peltier's very helpful solution to creating a quadrant chart in excel. Is there a way for me to include a legend key or to add data labels to each plotted point on the quadrant chart? Thanks in advance! -- deacs ------------------------------------------------------------------------ deacs's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2321 View this thread: http://www.excelforum.com/showthread.php?threadid=544313 You can add labels to plotted points manually (Format data series > data labels > choose some option, the...

Can't insert pictures - used to be able to
Had to reload XP and then reload Office 2000 Pub 2000. Since reload can't insert pictures into Publisher. Get error "Publisher cannot convert this picture....." Have tried all kinds of formats - jpg, tif, gif, pcx, even bmp. None will load. I've reloaded Publisher and made sure that all graphics converts are loaded. Anyone have any ideas? It used to work just fine. How large is this picture? "djg in Ohio" <anonymous@discussions.microsoft.com> wrote in message news:17da801c4199c$ddfeea80$a401280a@phx.gbl... > Had to reload XP and then reloa...

Running a report using a macro
Hi there I'm hoping someone can help me with this... I'm wanting to run a report from a worksheet that has around 15000 lines of data, based on two criteria. I have tried using Autofilter, but my computer keeps crashing. The report I'd like to run is based on a particular month. So say in the reporting worksheet (called Report) if I type in the month I'm interested in, in say cell A1, and have a button to press with the macro behind it, then the Macro would look at the data worksheet (called Data) and find all the records relevant to that particular month. (Th...

Removing the Disable/Enable Macros screen?
Is it possible to remove the Disable/Enable Macros screen when document loads ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com Alan, You can't disable the macro warning for a document. If you could, then any self-respecting virus would do exactly that. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Alan T" <Alan.T.x0eqn@excelforum-nospam.com> wrote in message news:Alan.T.x0eqn@excelforum-nospam....

Graph paper for charting patterns/showing objects to scale in a sp
Trying to locate the correct Office product to be able to layout a physical space showing objects to scale. AND being able to use graph paper to show a pattern Visio - but what you really want is some sort of a CAD program. By the way, this newsgroup is for people with questions about Publisher specifically, not Office in general. -- JoAnn Paules MVP Microsoft [Publisher] "Elaine" <Elaine@discussions.microsoft.com> wrote in message news:E0FDBF22-79EC-466E-AF54-56586A7BF503@microsoft.com... > Trying to locate the correct Office product to be able to layout a >...

How do I scroll through documents using the touchpad?
I used to be able to simply touch the touchpad and, by sliding my finger up or down, I could move up or down through a document. Since installing Windows 7 this feature doesn't work. Am I doing something wrong, is there something to turn on, or is this feature not available in this 'improved' Windows OS? Nothing to do with Word. On my new Acer Windows 7 laptop, the touchpad has a white vertical line at the right edge, and stroking along the right edge scrolls the window. There's a setting for whether it'll do that or not. Maybe your hardware doesn't ...

Textbox Code for Date Format
Pretty sure it's something silly on my part. form contain combobox 'Date' (It looks up dates from specified dates within payroll timeframes) No-Control text box placed next to combo box to have Day of Week appear to keep people on right day. (I don't like the calendar idea, because I need to keep people in the correct payroll date range and other items.) For text box, from property window / data tab / control source I've entered =Formate([Date],"dddd") expecting the day of the week to appear on focus. Field populates fine but shows wrong day of th...

Can I Sum by Cell Colour or Format?
I have a large list of values, these values have been colour coded. I would like to sum each of the colours seperately. I know i can add a filter, sort by colour & sum this for each coulour, but am wondering if there is a formula that would do this for me? Ashley, have a look here http://www.ozgrid.com/VBA/sum-count-cells-by-color.htm -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "Ashley" wrote: > I have a large list of values,...