View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Insert Picture Name Assignment in Macro

Try recording a macro when you add a label from the Forms toolbar to the
worksheet. You'll get something like:

ActiveSheet.Labels.Add(295.5, 82.5, 236.25, 21).Select

So I just changed it to:
Set myLabel = .Labels.Add(0, 0, 0, 0)

And I'd use that other code to move it and name it.


Frankenroc wrote:

Okay, this is kinda similar to the first...

How would I do the same with a label? I tried integrating the syntax
used for the picture into a line, but it didn't work as well, and I can
definately see this problem happening with that as well, since it used
the same structure as the picture. Here's what I tried for the
line...

Code:
--------------------
Dim myLabel As Label

With ActiveSheet
Set myLabel = .Shapes.AddLabel(msoTextOrientationHorizontal, NumericX, NumericY, 0#, 0#)
End With

With myLabel
.name = "Text " & Counter
End With
--------------------

--
Frankenroc
------------------------------------------------------------------------
Frankenroc's Profile: http://www.excelforum.com/member.php...o&userid=30609
View this thread: http://www.excelforum.com/showthread...hreadid=502620


--

Dave Peterson