Consulting

Results 1 to 2 of 2

Thread: Solved: Stop CommandButton moving or rename button

  1. #1
    VBAX Contributor JeffT's Avatar
    Joined
    Oct 2004
    Location
    Maidenhead, Nr London UK
    Posts
    105
    Location

    Solved: Stop CommandButton moving or rename button

    Hi

    I have a spreadsheet which has 2 commandbuttons on (in a freezepane area at the top so they are always visible). Sometimes using code I add columns and rows, but the buttons then move down and to the right.

    Is there anyway to fix the buttons one in Cell F1 & one in H1.

    I have tried copy & paste to put them back where they were which is successful but the (Name) property changes, CommandButton1 becomes CommandButton3 & CommandButton2 becomes CommandButton1 so they no longer activate the code they are there for. I guess this is because #1 uses the next available number when it is pasted e.g. 3 & then as #1 no longer exists this is used by CB2 when it is pasted.

    Hopefully this is quite simple. I've just thought, I could probably delete columns and rows before re adding them, so have another solution but I'd be interested in how to do this anyway.

    Thanks

    Jeff T

  2. #2
    VBAX Contributor JeffT's Avatar
    Joined
    Oct 2004
    Location
    Maidenhead, Nr London UK
    Posts
    105
    Location
    HiI changed the other code so the buttons don't move. Seemed easier.Jeff T

Posting Permissions

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