+ Reply to Thread
Results 1 to 2 of 2

Offset my buttons from activecell

  1. #1
    Registered User
    Join Date
    03-08-2011
    Location
    Lost battles California
    MS-Off Ver
    2010
    Posts
    1

    Question Offset my buttons from activecell

    All help welcome!

    I would like to have my command buttons follow with an offset from my selection using VBA.
    For instance, I select cell C7, I want my three command buttons to move to beginning F7.
    To offset from cell C7.
    thanks.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Offset my buttons from activecell

    Hi jlart and welcome to the forum,
    I wrote some code to do this a while back. Here it is:
    Please Login or Register  to view this content.
    First this must go behind the sheet, not in a module as it is event code. I hope you get that.
    Then in the Immediate Window do debug.print activesheeet.shapes(1).name so VBA will tell you which command button (really a shape) you are about to move around.
    Then put the correct index number to move one of your three buttons and base them on your ActiveCell.

    I had my single command button move to the right and below my clicked on cell. This way the command button was always in veiw of what I was seeing on the screen,

    Another way to accomplish a visible button is to put the Macro on the QAT (quick access toolbar). Hope all this helps.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ 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