+ Reply to Thread
Results 1 to 5 of 5

Format painter by macro

  1. #1
    Forum Contributor
    Join Date
    05-10-2016
    Location
    EUROPE
    MS-Off Ver
    Excel 365 64 bitt
    Posts
    178

    Format painter by macro

    Hi,

    I found this nice code on the internet for formating cells, it works good.
    But how can I make this code work like if I dont select cells to format then it would not bring the error: Run-time error '424' Object required
    I would like also to not bring the error in the case if I click cancel the message box.


    Please Login or Register  to view this content.
    Thanks in advance.
    B.

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Format painter by macro

    Trap the error and exit the Sub:

    Please Login or Register  to view this content.
    WBD

  3. #3
    Forum Contributor
    Join Date
    05-10-2016
    Location
    EUROPE
    MS-Off Ver
    Excel 365 64 bitt
    Posts
    178

    Re: Format painter by macro

    Hi,

    Thank you for this. Is it possible to make this whithout asking me to select cell.
    I mean just as in Excel I click the format painter and after that I just go and click the cell I desire to format?

    Thanks for helping.
    B.

  4. #4
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Format painter by macro

    Remove your other code and paste this into the ThisWorkbook module:

    Please Login or Register  to view this content.
    That should hopefully do what you're after.

    WBD

  5. #5
    Forum Contributor
    Join Date
    05-10-2016
    Location
    EUROPE
    MS-Off Ver
    Excel 365 64 bitt
    Posts
    178

    Re: Format painter by macro

    Hi,

    Thank u for this solution. This is nice one.

    All the best.

    T.B

+ 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. [SOLVED] Macro: Format Painter Button
    By synergeticink in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-28-2012, 07:03 PM
  2. Format painter
    By amandaphs in forum Excel General
    Replies: 3
    Last Post: 02-05-2012, 10:17 AM
  3. Emulate format painter in VBA
    By tapapad in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-18-2008, 10:18 AM
  4. how can I use the format painter??
    By hermosilla in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 08-11-2006, 07:00 PM
  5. Format Painter in VBA?
    By Angelus in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2006, 01:35 AM
  6. Macro to create format painter
    By JD in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-11-2005, 03:06 PM
  7. [SOLVED] format painter
    By Tom Whitmore in forum Excel General
    Replies: 4
    Last Post: 03-03-2005, 11:06 AM
  8. [SOLVED] Shortcut to format painter
    By judith in forum Excel General
    Replies: 3
    Last Post: 02-07-2005, 11:25 AM

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