+ Reply to Thread
Results 1 to 5 of 5

Keep Cell (Row & Column) format unchanged when activating VBA command button

  1. #1
    Forum Contributor
    Join Date
    04-07-2020
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    219

    Keep Cell (Row & Column) format unchanged when activating VBA command button

    Hi There

    I have a VBA code below that I picket up on the site to create a Work Sheet Index, Hyperlink and populate the sheet list on a sheet called "Index"

    The problem I have is, each time I click the command button to update the Sheet "Index" it removes my row coloring, borders and other cosmetic editing features in each cell.

    How can the code be adjusted to only copy the font and not change any formatting in Range A:A


    Please Login or Register  to view this content.
    Last edited by AliGW; 04-10-2020 at 01:24 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,877

    Re: Keep Cell (Row & Column) format unchanged when activating VBA command button

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are new, I have done it for you this time.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Keep Cell (Row & Column) format unchanged when activating VBA command button

    For starters try using ClearContents (removes only the content of a cell) instead of Clear (removes everything, like wiping the slate clean)
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  4. #4
    Forum Contributor
    Join Date
    04-07-2020
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    219

    Re: Keep Cell (Row & Column) format unchanged when activating VBA command button

    Thank you very much Bakerman 2. that works perfectly , much appreciated

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Keep Cell (Row & Column) format unchanged when activating VBA command button

    Glad to help.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. Command Button to format data with subtotals
    By Guestimator in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-10-2016, 03:08 PM
  2. [SOLVED] Shape as a button to replace a Command Button which operates conditional format.
    By A440 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-26-2015, 05:46 PM
  3. Command Button on form is activating sheet but not cell
    By GemaDilemma in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-01-2013, 01:18 AM
  4. Create Command Button and format
    By dmeinder in forum Word Programming / VBA / Macros
    Replies: 2
    Last Post: 04-18-2013, 10:26 AM
  5. Replies: 8
    Last Post: 07-27-2010, 04:17 PM
  6. Create a command button to format a group of worksheets
    By vjboaz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-12-2008, 09:34 AM
  7. Activating hyperlink with a command button?
    By cstandinguk in forum Excel General
    Replies: 5
    Last Post: 07-28-2007, 01:51 PM

Tags for this Thread

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