Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Changing the properties of a Shape/ AutoShape within a cell

I am so new I squeek
I need to put shapes/ autoshapes and small photos in a cell. Like cell( B:2)
How does one control the autoshape or photo properites using VBA?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Changing the properties of a Shape/ AutoShape within a cell

The easiest way with Excel/VBA is to record a macro (ToolsMacroRecord New
Macro) and see the generated code.
Whilst this code is generally not the most efficient, it gives you a
starting point to see the required syntax/objects to use.

NickHK

"wbntravis" wrote in message
...
I am so new I squeek
I need to put shapes/ autoshapes and small photos in a cell. Like cell(

B:2)
How does one control the autoshape or photo properites using VBA?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Changing the properties of a Shape/ AutoShape within a cell

Thanks Nick ! That helped show of some of the properties!
( I did not think of it because I had a macro on the tree shape already.)

Since I have more than one tree shape i was kinda looking for a name
property... so I could move different "name"d trees from one cell to another
based
on the players movement.

Here is how 2003 Excel indicates I selected the tree.




"wbntravis" wrote:

I am so new I squeek
I need to put shapes/ autoshapes and small photos in a cell. Like cell( B:2)
How does one control the autoshape or photo properites using VBA?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Changing the properties of a Shape/ AutoShape within a cell

Hit the wrong key and the prev message posted prematurely.

continue:
Here is how 2003 Excel shows I selected the object:
ActiveSheet.Shapes("Tree").Select

I have more than one "tree" in other cells. I would like
to give the trees different names so I can modify only
that object Ie: move it... or assign a rnd macro to it.

I have read help exhaustedly... thanks again!


"wbntravis" wrote:

Thanks Nick ! That helped show of some of the properties!
( I did not think of it because I had a macro on the tree shape already.)

Since I have more than one tree shape i was kinda looking for a name
property... so I could move different "name"d trees from one cell to another
based
on the players movement.

Here is how 2003 Excel indicates I selected the tree.




"wbntravis" wrote:

I am so new I squeek
I need to put shapes/ autoshapes and small photos in a cell. Like cell( B:2)
How does one control the autoshape or photo properites using VBA?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Changing the properties of a Shape/ AutoShape within a cell

Something like this ?

Private Sub CommandButton1_Click()
Dim NewTree As Shape
Dim i As Long

For i = 1 To 10
Set NewTree =
ActiveSheet.Shapes.AddShape(msoShapeFlowchartPrede finedProcess, 20 * i,
202.5, 174.75, 84.75)
With NewTree
.Name = "Tree_" & i
End With
Next
End Sub

NickHK

"wbntravis" wrote in message
...
Thanks Nick ! That helped show of some of the properties!
( I did not think of it because I had a macro on the tree shape already.)

Since I have more than one tree shape i was kinda looking for a name
property... so I could move different "name"d trees from one cell to

another
based
on the players movement.

Here is how 2003 Excel indicates I selected the tree.




"wbntravis" wrote:

I am so new I squeek
I need to put shapes/ autoshapes and small photos in a cell. Like

cell( B:2)
How does one control the autoshape or photo properites using VBA?





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Changing the properties of a Shape/ AutoShape within a cell



You are so close! That code produced 10 rectangles here with two smaller
rectangles off to one side for each object that was produced above the
worksheet. (which made ugly looking trees )
There were 10 of these ufos (unitendified flying objects ) to confirm the
for i = 10


so I did a little digging and
found a tree was an autoshape (not sure if that makes a difference)
and the name according to excel is BD18235.wmf (not sure if that makes
a difference. Your coding is interesting and the minute I saw it I almost
fell over to see the .name = Tree & i could do it.

I looked up
"NickHK" wrote:

Something like this ?

Private Sub CommandButton1_Click()
Dim NewTree As Shape
Dim i As Long

For i = 1 To 10
Set NewTree =
ActiveSheet.Shapes.AddShape(msoShapeFlowchartPrede finedProcess, 20 * i,
202.5, 174.75, 84.75)
With NewTree
.Name = "Tree_" & i
End With
Next
End Sub

NickHK

"wbntravis" wrote in message
...
Thanks Nick ! That helped show of some of the properties!
( I did not think of it because I had a macro on the tree shape already.)

Since I have more than one tree shape i was kinda looking for a name
property... so I could move different "name"d trees from one cell to

another
based
on the players movement.

Here is how 2003 Excel indicates I selected the tree.




"wbntravis" wrote:

I am so new I squeek
I need to put shapes/ autoshapes and small photos in a cell. Like

cell( B:2)
How does one control the autoshape or photo properites using VBA?




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Changing the properties of a Shape/ AutoShape within a cell

continued: hit the wrong key again
I looked up
"msoShapeFlowchartPredefinedProcess" to see what that joy was all about
but neither online of offline help wanted to give me anything.

Trust me, we I get this down I will name a tree after you.
Please dont roll your eyes- haha

wbnTravis


"wbntravis" wrote:



You are so close! That code produced 10 rectangles here with two smaller
rectangles off to one side for each object that was produced above the
worksheet. (which made ugly looking trees )
There were 10 of these ufos (unitendified flying objects ) to confirm the
for i = 10


so I did a little digging and
found a tree was an autoshape (not sure if that makes a difference)
and the name according to excel is BD18235.wmf (not sure if that makes
a difference. Your coding is interesting and the minute I saw it I almost
fell over to see the .name = Tree & i could do it.

I looked up
"NickHK" wrote:

Something like this ?

Private Sub CommandButton1_Click()
Dim NewTree As Shape
Dim i As Long

For i = 1 To 10
Set NewTree =
ActiveSheet.Shapes.AddShape(msoShapeFlowchartPrede finedProcess, 20 * i,
202.5, 174.75, 84.75)
With NewTree
.Name = "Tree_" & i
End With
Next
End Sub

NickHK

"wbntravis" wrote in message
...
Thanks Nick ! That helped show of some of the properties!
( I did not think of it because I had a macro on the tree shape already.)

Since I have more than one tree shape i was kinda looking for a name
property... so I could move different "name"d trees from one cell to

another
based
on the players movement.

Here is how 2003 Excel indicates I selected the tree.




"wbntravis" wrote:

I am so new I squeek
I need to put shapes/ autoshapes and small photos in a cell. Like

cell( B:2)
How does one control the autoshape or photo properites using VBA?




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Changing the properties of a Shape/ AutoShape within a cell

I just used that shape, as I didn't waht you meant by "tree". However, try
this. You may have to change the path depending on you installation/version
of Office.

Private Sub CommandButton1_Click()
Dim NewTree As Picture
Dim i As Long

Const TREEFILE As String = "C:\Program Files\Microsoft Office\Office
XP\media\office10\AutoShap\BD18253_.wmf"

For i = 1 To 10
Set NewTree = ActiveSheet.Pictures.Insert(TREEFILE)
With NewTree
.Left = Cells(10, i * 2).Left
.Name = "Tree_" & i
End With
Next
End Sub

NickHK

"wbntravis" wrote in message
...
continued: hit the wrong key again
I looked up
"msoShapeFlowchartPredefinedProcess" to see what that joy was all about
but neither online of offline help wanted to give me anything.

Trust me, we I get this down I will name a tree after you.
Please dont roll your eyes- haha

wbnTravis


"wbntravis" wrote:



You are so close! That code produced 10 rectangles here with two

smaller
rectangles off to one side for each object that was produced above the
worksheet. (which made ugly looking trees )
There were 10 of these ufos (unitendified flying objects ) to confirm

the
for i = 10


so I did a little digging and
found a tree was an autoshape (not sure if that makes a difference)
and the name according to excel is BD18235.wmf (not sure if that makes
a difference. Your coding is interesting and the minute I saw it I

almost
fell over to see the .name = Tree & i could do it.

I looked up
"NickHK" wrote:

Something like this ?

Private Sub CommandButton1_Click()
Dim NewTree As Shape
Dim i As Long

For i = 1 To 10
Set NewTree =
ActiveSheet.Shapes.AddShape(msoShapeFlowchartPrede finedProcess, 20 *

i,
202.5, 174.75, 84.75)
With NewTree
.Name = "Tree_" & i
End With
Next
End Sub

NickHK

"wbntravis" wrote in message
...
Thanks Nick ! That helped show of some of the properties!
( I did not think of it because I had a macro on the tree shape

already.)

Since I have more than one tree shape i was kinda looking for a name
property... so I could move different "name"d trees from one cell to
another
based
on the players movement.

Here is how 2003 Excel indicates I selected the tree.




"wbntravis" wrote:

I am so new I squeek
I need to put shapes/ autoshapes and small photos in a cell. Like
cell( B:2)
How does one control the autoshape or photo properites using VBA?





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Autoshape properties using formulas only Chris Excel Discussion (Misc queries) 0 September 7th 08 08:07 AM
help needed trying to find autoshape/shape name funkymonkUK[_174_] Excel Programming 1 May 23rd 06 04:01 PM
Bug? AutoShape position properties incorrect Nick Hebb Excel Programming 0 December 29th 05 10:24 PM
Cell changing it's properties jtpeters New Users to Excel 0 December 27th 05 10:09 PM
How to stop Excel from changing the cell properties? Ikke Excel Discussion (Misc queries) 5 May 4th 05 10:12 PM


All times are GMT +1. The time now is 05:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"