+ Reply to Thread
Results 1 to 6 of 6

Code to Force Format / Prevent Format Changes

  1. #1
    Registered User
    Join Date
    04-07-2011
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    49

    Code to Force Format / Prevent Format Changes

    Ok I've done this before so I know it's possible but I can't find my code so I hope you guys can help me out. I have report that people are going to be pasting data into. I want the destination formatting to override the format of pasted data. Now I know that you can just paste special or maybe double click in a cell and then paste. The problem is that I am working with very entry level excel users so I can't count on them know or remember that. This is excel 2007. Any help you could give would be appreciated.

    Thanks,

    -Michael
    Last edited by imogul; 04-26-2011 at 07:04 PM.

  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: Code to Force Format / Prevent Format Changes

    Embed a command button in your spreadsheet somewhere near the top and freeze panes so it's always visible. Use the following as it's source code:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-07-2011
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: Code to Force Format / Prevent Format Changes

    Thanks for the reply but that's not exactly what I'm looking for. I need the user to be able to paste the data into the sheet and hit print. So I need the sheet to just not allow format changes, but to still allow pasting without any extra dialog boxes.

  4. #4
    Registered User
    Join Date
    04-07-2011
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    49

    Talking Re: Code to Force Format / Prevent Format Changes

    I found my code! I'm going to post it just in case someone else ends up needing it.
    Just right click on the name of the sheet at the bottom of your screen and select "show code". Past it in, save it, close VBA and your done!

    Please Login or Register  to view this content.
    Last edited by imogul; 04-28-2011 at 12:31 PM.

  5. #5
    Registered User
    Join Date
    12-18-2014
    Location
    NY,NY
    MS-Off Ver
    2010
    Posts
    1

    Re: Code to Force Format / Prevent Format Changes

    Thanks a lot. I was looking for exactly this.

  6. #6
    Registered User
    Join Date
    02-18-2014
    Location
    Kenya
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Code to Force Format / Prevent Format Changes

    Excellent! This code works like a charm

+ 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