Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default CODE FOR TOOL

What is the code for "AUTOSHAPES - LINES - SCRIBBLE"

Thanks for any help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default CODE FOR TOOL

Turn on the macro recorder and create a scribble shape. Then turn off the
macro recorder and look at the code.

I got this:

Sub Macro1()
With ActiveSheet.Shapes.BuildFreeform(msoEditingCorner, 108.75, 154.5)
.AddNodes msoSegmentCurve, msoEditingCorner, 148.5, 155.25, 177#,
137.25, _
195.75, 165.75
.AddNodes msoSegmentCurve, msoEditingCorner, 196.5, 169.5, 198.75,
173.25, _
200.25, 177#
.AddNodes msoSegmentCurve, msoEditingCorner, 199.5, 187.5, 193.5,
188.25, _
183.75, 189#
.AddNodes msoSegmentCurve, msoEditingCorner, 178.5, 190.5, 172.5,
192#, _
167.25, 193.5
.AddNodes msoSegmentCurve, msoEditingCorner, 164.25, 196.5, 159#,
199.5, _
155.25, 202.5
.AddNodes msoSegmentCurve, msoEditingCorner, 153.75, 205.5, 150.75,
211.5, _
150.75, 211.5
.AddNodes msoSegmentCurve, msoEditingCorner, 152.25, 237.75, 162.75,
228#, _
192.75, 228.75
.AddNodes msoSegmentCurve, msoEditingCorner, 195#, 234.75, 198#,
242.25, _
201.75, 247.5
.AddNodes msoSegmentCurve, msoEditingCorner, 201#, 260.25, 203.25,
266.25, _
192.75, 273#
.AddNodes msoSegmentCurve, msoEditingCorner, 188.25, 279.75, 178.5,
284.25, _
171#, 287.25
.AddNodes msoSegmentCurve, msoEditingCorner, 153#, 287.25, 134.25,
287.25, _
116.25, 286.5
.AddNodes msoSegmentCurve, msoEditingCorner, 111#, 286.5, 101.25,
271.5, _
98.25, 267.75
.AddNodes msoSegmentCurve, msoEditingCorner, 96#, 264.75, 91.5,
260.25, _
91.5, 260.25
.AddNodes msoSegmentCurve, msoEditingCorner, 90#, 255.75, 87#,
251.25, _
84.75, 247.5
.AddNodes msoSegmentCurve, msoEditingCorner, 82.5, 239.25, 80.25,
232.5, _
79.5, 223.5
.AddNodes msoSegmentCurve, msoEditingCorner, 80.25, 199.5, 75.75,
198#, _
98.25, 195.75
.AddNodes msoSegmentCurve, msoEditingCorner, 108.75, 189#, 107.25,
192#, _
126.75, 192#
.ConvertToShape.Select
End With
End Sub

--
Regards,
Tom Ogilvy

"Ronbo" wrote in message
...
What is the code for "AUTOSHAPES - LINES - SCRIBBLE"

Thanks for any help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default CODE FOR TOOL

Thanks for the response, Tom. I started with this approach and got the same
results. The problem is it leaves a freeform and I don't want that.

What I want is a routine that will perform the three actions and end with
the scribble icon "pencil" on, ready to draw.

I have been trying to strip the code down, but so far no luck. It seems to
have to create some sort of a freefrom to work, and that does not work for me.

Ronbo

"Tom Ogilvy" wrote:

Turn on the macro recorder and create a scribble shape. Then turn off the
macro recorder and look at the code.

I got this:

Sub Macro1()
With ActiveSheet.Shapes.BuildFreeform(msoEditingCorner, 108.75, 154.5)
.AddNodes msoSegmentCurve, msoEditingCorner, 148.5, 155.25, 177#,
137.25, _
195.75, 165.75
.AddNodes msoSegmentCurve, msoEditingCorner, 196.5, 169.5, 198.75,
173.25, _
200.25, 177#
.AddNodes msoSegmentCurve, msoEditingCorner, 199.5, 187.5, 193.5,
188.25, _
183.75, 189#
.AddNodes msoSegmentCurve, msoEditingCorner, 178.5, 190.5, 172.5,
192#, _
167.25, 193.5
.AddNodes msoSegmentCurve, msoEditingCorner, 164.25, 196.5, 159#,
199.5, _
155.25, 202.5
.AddNodes msoSegmentCurve, msoEditingCorner, 153.75, 205.5, 150.75,
211.5, _
150.75, 211.5
.AddNodes msoSegmentCurve, msoEditingCorner, 152.25, 237.75, 162.75,
228#, _
192.75, 228.75
.AddNodes msoSegmentCurve, msoEditingCorner, 195#, 234.75, 198#,
242.25, _
201.75, 247.5
.AddNodes msoSegmentCurve, msoEditingCorner, 201#, 260.25, 203.25,
266.25, _
192.75, 273#
.AddNodes msoSegmentCurve, msoEditingCorner, 188.25, 279.75, 178.5,
284.25, _
171#, 287.25
.AddNodes msoSegmentCurve, msoEditingCorner, 153#, 287.25, 134.25,
287.25, _
116.25, 286.5
.AddNodes msoSegmentCurve, msoEditingCorner, 111#, 286.5, 101.25,
271.5, _
98.25, 267.75
.AddNodes msoSegmentCurve, msoEditingCorner, 96#, 264.75, 91.5,
260.25, _
91.5, 260.25
.AddNodes msoSegmentCurve, msoEditingCorner, 90#, 255.75, 87#,
251.25, _
84.75, 247.5
.AddNodes msoSegmentCurve, msoEditingCorner, 82.5, 239.25, 80.25,
232.5, _
79.5, 223.5
.AddNodes msoSegmentCurve, msoEditingCorner, 80.25, 199.5, 75.75,
198#, _
98.25, 195.75
.AddNodes msoSegmentCurve, msoEditingCorner, 108.75, 189#, 107.25,
192#, _
126.75, 192#
.ConvertToShape.Select
End With
End Sub

--
Regards,
Tom Ogilvy

"Ronbo" wrote in message
...
What is the code for "AUTOSHAPES - LINES - SCRIBBLE"

Thanks for any help.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default CODE FOR TOOL

Sub ShowScribble()
CommandBars("Drawing").Controls("A&utoShapes") _
.Controls("&Lines").Controls("&Scribble").Execute
End Sub


Sub ShowScribble1()
Dim ctrl As CommandBarButton
On Error Resume Next
Set ctrl = CommandBars("Drawing").FindControl(Id:=409, Recursive:=True)
On Error GoTo 0
If Not ctrl Is Nothing Then
ctrl.Execute
Else
MsgBox "Scribble Control not found"
End If
End Sub

both worked for me.

--
Regards,
Tom Ogilvy


"Ronbo" wrote in message
...
Thanks for the response, Tom. I started with this approach and got the
same
results. The problem is it leaves a freeform and I don't want that.

What I want is a routine that will perform the three actions and end with
the scribble icon "pencil" on, ready to draw.

I have been trying to strip the code down, but so far no luck. It seems
to
have to create some sort of a freefrom to work, and that does not work for
me.

Ronbo

"Tom Ogilvy" wrote:

Turn on the macro recorder and create a scribble shape. Then turn off
the
macro recorder and look at the code.

I got this:

Sub Macro1()
With ActiveSheet.Shapes.BuildFreeform(msoEditingCorner, 108.75,
154.5)
.AddNodes msoSegmentCurve, msoEditingCorner, 148.5, 155.25, 177#,
137.25, _
195.75, 165.75
.AddNodes msoSegmentCurve, msoEditingCorner, 196.5, 169.5,
198.75,
173.25, _
200.25, 177#
.AddNodes msoSegmentCurve, msoEditingCorner, 199.5, 187.5, 193.5,
188.25, _
183.75, 189#
.AddNodes msoSegmentCurve, msoEditingCorner, 178.5, 190.5, 172.5,
192#, _
167.25, 193.5
.AddNodes msoSegmentCurve, msoEditingCorner, 164.25, 196.5, 159#,
199.5, _
155.25, 202.5
.AddNodes msoSegmentCurve, msoEditingCorner, 153.75, 205.5,
150.75,
211.5, _
150.75, 211.5
.AddNodes msoSegmentCurve, msoEditingCorner, 152.25, 237.75,
162.75,
228#, _
192.75, 228.75
.AddNodes msoSegmentCurve, msoEditingCorner, 195#, 234.75, 198#,
242.25, _
201.75, 247.5
.AddNodes msoSegmentCurve, msoEditingCorner, 201#, 260.25,
203.25,
266.25, _
192.75, 273#
.AddNodes msoSegmentCurve, msoEditingCorner, 188.25, 279.75,
178.5,
284.25, _
171#, 287.25
.AddNodes msoSegmentCurve, msoEditingCorner, 153#, 287.25,
134.25,
287.25, _
116.25, 286.5
.AddNodes msoSegmentCurve, msoEditingCorner, 111#, 286.5, 101.25,
271.5, _
98.25, 267.75
.AddNodes msoSegmentCurve, msoEditingCorner, 96#, 264.75, 91.5,
260.25, _
91.5, 260.25
.AddNodes msoSegmentCurve, msoEditingCorner, 90#, 255.75, 87#,
251.25, _
84.75, 247.5
.AddNodes msoSegmentCurve, msoEditingCorner, 82.5, 239.25, 80.25,
232.5, _
79.5, 223.5
.AddNodes msoSegmentCurve, msoEditingCorner, 80.25, 199.5, 75.75,
198#, _
98.25, 195.75
.AddNodes msoSegmentCurve, msoEditingCorner, 108.75, 189#,
107.25,
192#, _
126.75, 192#
.ConvertToShape.Select
End With
End Sub

--
Regards,
Tom Ogilvy

"Ronbo" wrote in message
...
What is the code for "AUTOSHAPES - LINES - SCRIBBLE"

Thanks for any help.






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default CODE FOR TOOL

They both worked PERFECTLY for me also. Thanks a lot for your time and
expertise. That is exactly what I needed.

"Tom Ogilvy" wrote:

Sub ShowScribble()
CommandBars("Drawing").Controls("A&utoShapes") _
.Controls("&Lines").Controls("&Scribble").Execute
End Sub


Sub ShowScribble1()
Dim ctrl As CommandBarButton
On Error Resume Next
Set ctrl = CommandBars("Drawing").FindControl(Id:=409, Recursive:=True)
On Error GoTo 0
If Not ctrl Is Nothing Then
ctrl.Execute
Else
MsgBox "Scribble Control not found"
End If
End Sub

both worked for me.

--
Regards,
Tom Ogilvy


"Ronbo" wrote in message
...
Thanks for the response, Tom. I started with this approach and got the
same
results. The problem is it leaves a freeform and I don't want that.

What I want is a routine that will perform the three actions and end with
the scribble icon "pencil" on, ready to draw.

I have been trying to strip the code down, but so far no luck. It seems
to
have to create some sort of a freefrom to work, and that does not work for
me.

Ronbo

"Tom Ogilvy" wrote:

Turn on the macro recorder and create a scribble shape. Then turn off
the
macro recorder and look at the code.

I got this:

Sub Macro1()
With ActiveSheet.Shapes.BuildFreeform(msoEditingCorner, 108.75,
154.5)
.AddNodes msoSegmentCurve, msoEditingCorner, 148.5, 155.25, 177#,
137.25, _
195.75, 165.75
.AddNodes msoSegmentCurve, msoEditingCorner, 196.5, 169.5,
198.75,
173.25, _
200.25, 177#
.AddNodes msoSegmentCurve, msoEditingCorner, 199.5, 187.5, 193.5,
188.25, _
183.75, 189#
.AddNodes msoSegmentCurve, msoEditingCorner, 178.5, 190.5, 172.5,
192#, _
167.25, 193.5
.AddNodes msoSegmentCurve, msoEditingCorner, 164.25, 196.5, 159#,
199.5, _
155.25, 202.5
.AddNodes msoSegmentCurve, msoEditingCorner, 153.75, 205.5,
150.75,
211.5, _
150.75, 211.5
.AddNodes msoSegmentCurve, msoEditingCorner, 152.25, 237.75,
162.75,
228#, _
192.75, 228.75
.AddNodes msoSegmentCurve, msoEditingCorner, 195#, 234.75, 198#,
242.25, _
201.75, 247.5
.AddNodes msoSegmentCurve, msoEditingCorner, 201#, 260.25,
203.25,
266.25, _
192.75, 273#
.AddNodes msoSegmentCurve, msoEditingCorner, 188.25, 279.75,
178.5,
284.25, _
171#, 287.25
.AddNodes msoSegmentCurve, msoEditingCorner, 153#, 287.25,
134.25,
287.25, _
116.25, 286.5
.AddNodes msoSegmentCurve, msoEditingCorner, 111#, 286.5, 101.25,
271.5, _
98.25, 267.75
.AddNodes msoSegmentCurve, msoEditingCorner, 96#, 264.75, 91.5,
260.25, _
91.5, 260.25
.AddNodes msoSegmentCurve, msoEditingCorner, 90#, 255.75, 87#,
251.25, _
84.75, 247.5
.AddNodes msoSegmentCurve, msoEditingCorner, 82.5, 239.25, 80.25,
232.5, _
79.5, 223.5
.AddNodes msoSegmentCurve, msoEditingCorner, 80.25, 199.5, 75.75,
198#, _
98.25, 195.75
.AddNodes msoSegmentCurve, msoEditingCorner, 108.75, 189#,
107.25,
192#, _
126.75, 192#
.ConvertToShape.Select
End With
End Sub

--
Regards,
Tom Ogilvy

"Ronbo" wrote in message
...
What is the code for "AUTOSHAPES - LINES - SCRIBBLE"

Thanks for any help.






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
Tool / Code to copy and paste only the conditional formatting rules Andibevan Excel Programming 0 August 9th 06 12:01 PM
Tool bar help TUNGANA KURMA RAJU Excel Discussion (Misc queries) 0 January 10th 06 04:16 AM
I am missing view tool bar from tool menu. excel New Users to Excel 1 July 4th 05 07:19 PM
Add-In / Tool / VBA Code for Renaming Range Names No Name Excel Programming 1 February 12th 04 07:58 PM
VBA code to make a progress tool bar work Jeff Marshall Excel Programming 2 October 11th 03 11:18 PM


All times are GMT +1. The time now is 03:19 AM.

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

About Us

"It's about Microsoft Excel"