+ Reply to Thread
Results 1 to 4 of 4

Excel Macro - Shape size desired not corresponding to correct Height and Width

  1. #1
    Registered User
    Join Date
    08-18-2020
    Location
    USA
    MS-Off Ver
    2019
    Posts
    7

    Question Excel Macro - Shape size desired not corresponding to correct Height and Width

    Hello,

    I'm trying to make an Excel Macro where a box automatically sizes to the unit dimensions (inches) the user puts in.

    Attached and below is a photo that describes everything I have so far.

    Pic.jpg

    You'll notice in the bright blue box I have

    dimension D = 20 inches (sometimes written as 20") and

    dimension L = 100 inches (100").

    Below is the orange box that automatically resizes to these dimensions (or... it should be that is ). Below this box is the macro code for the sheet.

    Now at the very right, you'll see the FORMAT SHAPE settings for this orange box. Next to Height and Width, you'll notice that the numbers don't match the values that the user inputted.

    In the middle is where I was trying to figure out why... Apparently, even though I'm putting in 100" for dimension L, the Width value being put in is following a formula: Width = 0.01391*(Dimension L)-0.0024

    For dimension D, its doing the same thing: Height= 0.01391*(Dimension D)-0.0024

    How can get the user inputted dimensions to match the dimensions in the box settings? I feel like I'm really close but I'm having trouble figuring out the last step it seems.
    Attached Files Attached Files

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Excel Macro - Shape size desired not corresponding to correct Height and Width

    Hi there,

    Try using:

    Please Login or Register  to view this content.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    08-18-2020
    Location
    USA
    MS-Off Ver
    2019
    Posts
    7

    Re: Excel Macro - Shape size desired not corresponding to correct Height and Width

    Greg M,

    Thank you! That is just what I needed!

    Respectfully,
    Owen T

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Excel Macro - Shape size desired not corresponding to correct Height and Width

    Hi again,

    Many thanks for your very prompt feedback and also for the Reputation increase - much appreciated!

    You're welcome - glad I was able to help.

    Best regards,

    Greg M

+ 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. Excel will not print images at correct height/width!!
    By vigilantezack in forum Excel General
    Replies: 25
    Last Post: 07-04-2022, 07:45 AM
  2. sizing picture in Outlook (Width & Height) macro
    By Pi* in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-16-2017, 08:33 PM
  3. Replies: 3
    Last Post: 05-16-2015, 04:42 PM
  4. to make shape of boxes with height and width in charts
    By k.sathyabhama in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 05-04-2013, 11:23 AM
  5. Replies: 3
    Last Post: 03-22-2013, 12:19 AM
  6. Macro to return the height and width of an object in the clipboard
    By Nicky in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-15-2008, 05:20 AM
  7. [SOLVED] Is it possible to view or size column width and/or row height in .
    By GeoMulak in forum Excel General
    Replies: 1
    Last Post: 04-13-2005, 07:06 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