Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
CODE FOR TOOL
What is the code for "AUTOSHAPES - LINES - SCRIBBLE"
Thanks for any help. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Tool / Code to copy and paste only the conditional formatting rules | Excel Programming | |||
Tool bar help | Excel Discussion (Misc queries) | |||
I am missing view tool bar from tool menu. | New Users to Excel | |||
Add-In / Tool / VBA Code for Renaming Range Names | Excel Programming | |||
VBA code to make a progress tool bar work | Excel Programming |