Excel Draw Tools

RY_VT

Board Regular
Joined
Oct 31, 2015
Messages
80
Anyone know the code to select the a pen of specific color in the draw tool ribbon? OR point me in the direction online? I can't seem to find anything for this online. I'd like to have a button press select the pen.

Thanks in advance!
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Try using the Macro Recorder then select the tool you want format your line the way you want.
Modify the code later if needed.
 
Upvote 0
That was the first think I tried and it didn't seem to record anything. I used different pens and different colors, but nada.
 
Upvote 0
I just recorded this with the Macro Recorder.

Code:
Sub DrawMe()
'
' DrawMe Macro
'
'
    ActiveSheet.Shapes.AddConnector(msoConnectorStraight, 200.25, 62.25, 542.25, _
        156).Select
        Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadTriangle
    With Selection.ShapeRange.Line
        .Visible = msoTrue
        .ForeColor.ObjectThemeColor = msoThemeColorAccent1
        .ForeColor.TintAndShade = 0
        .ForeColor.Brightness = -0.25
        .Transparency = 0
    End With
    With Selection.ShapeRange.Line
        .Visible = msoTrue
        .Weight = 2.25
    End With
    Range("J15").Select
End Sub
 
Upvote 0
I just recorded this with the Macro Recorder.

Code:
Sub DrawMe()
'
' DrawMe Macro
'
'
    ActiveSheet.Shapes.AddConnector(msoConnectorStraight, 200.25, 62.25, 542.25, _
        156).Select
        Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadTriangle
    With Selection.ShapeRange.Line
        .Visible = msoTrue
        .ForeColor.ObjectThemeColor = msoThemeColorAccent1
        .ForeColor.TintAndShade = 0
        .ForeColor.Brightness = -0.25
        .Transparency = 0
    End With
    With Selection.ShapeRange.Line
        .Visible = msoTrue
        .Weight = 2.25
    End With
    Range("J15").Select
End Sub


This is drawing line with an arrow...I wanted to free draw with the pen tool. I would select press a button and the pen tool would be enabled, rather than the curser.
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,223
Members
452,620
Latest member
dsubash

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top