How to make box with dimension

faizee

Board Regular
Joined
Jan 28, 2009
Messages
214
Office Version
  1. 2016
Platform
  1. Windows
Dear all
I just need to know that is it possible in excel that we could make box with length,width,height dimensions?

for example: we just enter 100mm is length, 70mm is width and 30mm is height.. so excel will make box according to this size
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
See if you can adapt this:

Code:
Sub Test()
    Dim Length As Double
    Dim Width As Double
    Dim Height As Double
    Dim Box As Shape
    With ActiveSheet
        Length = Application.CentimetersToPoints(.Range("A1").Value / 100)
        Width = Application.CentimetersToPoints(.Range("A2").Value / 100)
        Height = Application.CentimetersToPoints(.Range("A3").Value / 100)
        Set Box = .Shapes.AddShape(msoShapeRectangle, 50, 50, Width, Height)
        With Box
            .ThreeD.Visible = msoTrue
            .ThreeD.Depth = Length
        End With
    End With
End Sub
 
Upvote 0
can you please tell me in more detail
how to enter these codes in excel

and how to execute it
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top