+ Reply to Thread
Results 1 to 7 of 7

Macro to change font size help

  1. #1
    Forum Contributor
    Join Date
    06-10-2008
    Location
    SW Ontario, Canada
    MS-Off Ver
    Excel 365
    Posts
    154

    Macro to change font size help

    I am relatively new with VBA and muddle my way through.
    I recorded a macro to get an idea of how to create changed font size to 1 in selected ranges.
    Then I deleted most of the 'fluff' from the recorded macro to get this.
    I have been trying for a few hours to make this work with different things but to no avail.
    Can someone give me some insight on this please and thank you.

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    833

    Re: Macro to change font size help

    Hi, I am not really into selecting a lot, but this seems the trick in this matter:
    Please Login or Register  to view this content.
    I added the value and the coloring for testing purposes (in order that I can see what I am doing)
    Cheers
    Erwin
    I started learning VBA because I was lazy ...
    Still developing.... being more lazy...

  3. #3
    Forum Contributor
    Join Date
    06-10-2008
    Location
    SW Ontario, Canada
    MS-Off Ver
    Excel 365
    Posts
    154

    Re: Macro to change font size help

    Thanks, that is working.
    But when I combine.
    The first section does not, the last one does.
    Please Login or Register  to view this content.
    EDIT: My mistake, missing the End With
    Last edited by kriminaal; 05-20-2020 at 12:43 PM.

  4. #4
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    833

    Re: Macro to change font size help

    you forget one time "end with"
    Please Login or Register  to view this content.
    Cheers
    Erwin

  5. #5
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    833

    Re: Macro to change font size help

    If you set this standard on top of your procedures, it will never happen again
    Please Login or Register  to view this content.
    via Extra, Options, check require variable declaration.

    Cheers
    Érwin

  6. #6
    Forum Contributor
    Join Date
    06-10-2008
    Location
    SW Ontario, Canada
    MS-Off Ver
    Excel 365
    Posts
    154

    Re: Macro to change font size help

    Excellent, thanks for the help.

  7. #7
    Forum Contributor
    Join Date
    06-10-2008
    Location
    SW Ontario, Canada
    MS-Off Ver
    Excel 365
    Posts
    154

    Re: Macro to change font size help

    Do you see anything wrong in this?
    Only the last section works.
    Something with how it's compiled I'm guessing.
    Please Login or Register  to view this content.

    EDIT: for those reading....it seems this does not work with the sheet protected.
    Last edited by kriminaal; 05-21-2020 at 08:23 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro for Automatic Font Size Change for Two Different Cell Values
    By nicholasmarella in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-10-2020, 02:19 PM
  2. [SOLVED] Can I change Font size without changing cell size? Or confine row height change to one col
    By j_Southern in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-10-2018, 11:18 AM
  3. PPTX macro needed to change font size on an entire slide
    By kzaveri19 in forum PowerPoint Programing
    Replies: 1
    Last Post: 12-16-2016, 12:17 PM
  4. Macro to Change Font Size Based on if Cell Contains Specific Text
    By karpfy19 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-24-2016, 08:12 PM
  5. [SOLVED] Change default font and font size on COMMENTS in cells
    By Thistledown in forum Excel General
    Replies: 4
    Last Post: 11-23-2012, 09:26 AM
  6. [SOLVED] How do I change a macro's font size?
    By dave60610 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2006, 12:35 PM

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