ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cell to macro (https://www.excelbanter.com/excel-programming/443415-cell-macro.html)

eLaCiD[_2_]

Cell to macro
 
Hallo all

Is there a way content from cell (for example content of A1, A2, A3 and A4) put in macro :

Sub MakroN1()

ActiveSheet.Shapes.AddShape(msoShapeRectangle, A1, A2, A3, A4). _
Select
End Sub

In short, as you can see, intent is that cell contents through macro command draw a square.


Dave Peterson[_2_]

Cell to macro
 
With no checking to make sure the values make sense:

Sub MakroN1()
with activesheet
.Shapes.AddShape(msoShapeRectangle, _
.range("A1").value, _
.range("A2").value, _
.range("A3").value, _
.range("A4").value).Select
end with
End Sub



On 07/27/2010 03:27, eLaCiD wrote:
Hallo all

Is there a way content from cell (for example content of A1, A2, A3 and A4) put in macro :

Sub MakroN1()

ActiveSheet.Shapes.AddShape(msoShapeRectangle, A1, A2, A3, A4). _
Select
End Sub

In short, as you can see, intent is that cell contents through macro command draw a square.


--
Dave Peterson


All times are GMT +1. The time now is 12:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com