+ Reply to Thread
Results 1 to 7 of 7

Draw a box in a userform using cell values

  1. #1
    Registered User
    Join Date
    08-18-2015
    Location
    Birmimgham
    MS-Off Ver
    2015
    Posts
    78

    Draw a box in a userform using cell values

    Hi. I am trying to create a userform that will calculate the amount of material used on a floor area by simply entering values into boxes/cells. I would like the userform to generate an image/create lines to represent the floor. How should I go about this? Thanks.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Draw a box in a userform using cell values

    simply entering values into boxes/cells
    You need to be a lot more concrete than this. Show what boxes/cells you mean and how you would enter the data, and include an example of what you want the resulting drawing to look like.

    Is the floor always a rectangle? If the floor is an irregular shape then I think you have little hope of doing this in Excel. You should use a drawing tool like Visio or Sketchup.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Draw a box in a userform using cell values

    We need more information.

    Is this a perfectly square floor, or are there recesses or projections? i.e. more than four lengths at right angles to each other

    Upload a workbook in which you have manually added shapes that represent all the sorts of rooms.
    If it's more than a simple rectangle/square then the image will need building up from several shapes.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Draw a box in a userform using cell values

    made me laff'

    You need to be a lot more concrete than this.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  5. #5
    Registered User
    Join Date
    08-18-2015
    Location
    Birmimgham
    MS-Off Ver
    2015
    Posts
    78

    Re: Draw a box in a userform using cell values

    Thank you for all your replies. The floor will be a rectangle. I just need to enter the length and width into a textbox and generate a drawing on the screen, a bit like how a rectangle is created in a CAD application. Would Shapes.AddShape be my best route? Once I have achieved this then I can work on some VBA code to calculate certain materials.

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Draw a box in a userform using cell values

    A rectangle would be pretty straightforward. What scale do you want to use? If you already have an Excel file you are working with it would speed things up to attach it.

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Draw a box in a userform using cell values

    Does the attached give you a starter.

    You may wish to change the position of the shape (the first two variables in the .AddShape macro
    Attached Files Attached Files

+ 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. [SOLVED] VBA code to draw values from one cell and deposit into a table below
    By anthony777 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-28-2017, 10:50 AM
  2. Draw triangle that changes size depending on cell values.
    By alasdairfraser in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-20-2016, 11:08 PM
  3. userform that allows a window to draw in
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-28-2014, 07:35 PM
  4. Draw Line in Userform.
    By ebin charles in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-01-2010, 07:03 AM
  5. Draw line on userform
    By proepert in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-22-2010, 11:33 PM
  6. Draw in Userform
    By Herve_Rob in forum Excel General
    Replies: 0
    Last Post: 05-22-2007, 11:44 AM
  7. draw shape based on cell values
    By Defoes Right Boot in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-10-2006, 11:22 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