![]() |
can excel draw a shape based on values entered in cells
I want to draw a rectangle which is sized by measurements entered on a
different sheet |
Assuming you have a rectangle named "Rectangle 1" on worksheet 1, and
your size data is contained on worksheet 2, you could enter the following code which would size the shape object upon clicking a command button. Private Sub cmdProcess_Click() ActiveSheet.Shapes("rectangle 1").Width = Worksheets("Sheet2").Range("a1") ActiveSheet.Shapes("rectangle 1").Height = Worksheets("Sheet2").Range("b1") ActiveSheet.Shapes("rectangle 1").Left = Worksheets("Sheet2").Range("c1") ActiveSheet.Shapes("rectangle 1").Top = Worksheets("Sheet2").Range("d1") End Sub |
All times are GMT +1. The time now is 01:18 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com