+ Reply to Thread
Results 1 to 4 of 4

Trying to scale a form checkbox in a macro, don't know how to get checkbox name

  1. #1
    Registered User
    Join Date
    01-07-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    2

    Trying to scale a form checkbox in a macro, don't know how to get checkbox name

    First off, let me apologize because I'm a complete newbie when it comes to programming in Excel.

    I'm trying to insert a row that includes a checkbox (centered in the cell) that has it's linked cell adjacent to it. I've been able to cobble together the code to make this happen. The problem I'm having is that the height of the newly created checkbox is larger than that of the row, so that when the macro is called again, it distorts the checkbox above. Below is the code that I have so far:

    Please Login or Register  to view this content.
    I've attempted to modify the top and height, but I can't get a satisfactory result. Any help in trying to get the checkbox to fit within the row height?

    Please let me know if you need any further info and I'll try to answer to the best of my ability.

    Thanks.

  2. #2
    Forum Contributor
    Join Date
    10-30-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2013
    Posts
    173

    Re: Trying to scale a form checkbox in a macro, don't know how to get checkbox name

    You just need to experiment and take a logical approach.
    By doing that you can figure out that the check box is offset by 3.5 and the box is 9.5 x 9.5
    So you subtract 3.5 to align it with the left edge of the cell, then ad 9.5/2 to align the center of the check box with the left edge of the cell, then offset it by half the cell width.

    For the height, you can just record a macro while you adjust it and you will find that the property you need is scaleheight

    Please Login or Register  to view this content.
    Or you can make yourself a tool like this

    Please Login or Register  to view this content.
    Then put a number to the left to be the Top offset and a number to the right to be the left offset...
    checkbox.jpg

    ... and experiment
    Then when you have something close, find the best compromise
    final checkbox.jpg

    Then after a little bit of fine tuning

    Please Login or Register  to view this content.
    is your best compromise.
    Last edited by coolblue; 01-08-2014 at 03:57 AM.

  3. #3
    Registered User
    Join Date
    01-07-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: Trying to scale a form checkbox in a macro, don't know how to get checkbox name

    Thanks so much for your help!

  4. #4
    Forum Contributor
    Join Date
    10-30-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2013
    Posts
    173

    Re: Trying to scale a form checkbox in a macro, don't know how to get checkbox name

    Hi, did it solve your problem?
    Did you try the tool to see how to do it for yourself?

+ 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. Replies: 2
    Last Post: 03-19-2013, 08:01 AM
  2. [SOLVED] How do I change a checkbox to unchecked without running the code within the checkbox
    By jsunnb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-27-2012, 09:28 PM
  3. [SOLVED] Use excel form Checkbox and tweak macro to suit.
    By Craigside in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-17-2012, 06:16 PM
  4. [SOLVED] Macro for creating checkbox in the Form
    By Webtekr in forum Word Programming / VBA / Macros
    Replies: 2
    Last Post: 04-03-2009, 05:40 AM
  5. checkbox on form reset from checkbox on sheet
    By raw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-03-2005, 01:15 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