+ Reply to Thread
Results 1 to 10 of 10

Change Font & Size in All Worksheets

  1. #1
    Registered User
    Join Date
    04-07-2011
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Change Font & Size in All Worksheets

    I'm trying to change all fonts in a workbook via vba. I would ideally like to change the font and size for everything in each sheet and then go back and make the top row larger and underlined for the headers. So far I can only make it change the activesheet and not all others. I'm brand new to looping so I think there lies the problem....

    Please Login or Register  to view this content.
    Thanks!

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Change Font & Size in All Worksheets

    This should do the trick
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-07-2011
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Change Font & Size in All Worksheets

    Thanks for the quick feedback. I just came across this and it worked, but I like your example better.

    Please Login or Register  to view this content.
    My next question will be I'm trying to bold and underline all text in Row 1 for the header. By underline, I mean a bottom line on the cell, not underlining the actual text. I know .bold = true should work for the bold, but I'm researching the underline part. Since I'm selecting the entire row, however, it's going to underline past the last cell with text. Is there a way to make it only underline occupied cells?

    Thanks!

  4. #4
    Registered User
    Join Date
    04-07-2011
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Change Font & Size in All Worksheets

    Here's what I've got so far:

    Please Login or Register  to view this content.
    It's saying "Compile Error: Next without For"

    Not sure why...

  5. #5
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Change Font & Size in All Worksheets

    try:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-07-2011
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Change Font & Size in All Worksheets

    Works like a charm....not to sound like a pest, but I have one more issue that is definitely above my level of VBA....

    Each sheet has columns B & C with numbers. I'd like to total these numbers a few rows down from the last occupied cell.

    It would probably be something like:

    mycount = Application.Count(Range("B:B"))

    Offset(Range("B & Mycount),2,0)

    =sum("B2:B & Mycount)

    I'd love to get to a point where this becomes easy...I think the book that I'm starting with is a little to complex for me....maybe "VBA for dummies" would be a better start!!

    Thanks again...

  7. #7
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Change Font & Size in All Worksheets

    try:
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    04-07-2011
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Change Font & Size in All Worksheets

    Ok. Thanks so much for your help. I actually got the totals to work another way I found on Google, but your method seems more clear to me.

    Below is what I believe to be the finished product. I will make the change for the subtotals that you show, but other than that, is there any room for cleanup or anything you might suggest doing differently?

    Please Login or Register  to view this content.
    Thanks again!

  9. #9
    Registered User
    Join Date
    08-12-2012
    Location
    jamnagar india
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Change Font & Size in All Worksheets

    by running this macro for change in font & size of all sheets in one work book ecxel is getting closed & then restarted without the effect of macro can somebody help on this topic

  10. #10
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: Change Font & Size in All Worksheets

    @vikram.malout
    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1