ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Create or change color of a (line with arrow head) with a Macro en (https://www.excelbanter.com/excel-programming/350903-create-change-color-line-arrow-head-macro-en.html)

Ed

Create or change color of a (line with arrow head) with a Macro en
 
Hi
Can an item (a line with arrowhead as created by the Drawing function for
example) be created and/or the color of it changed by an entry or entries
in a Macro when certain conditions exist?
If this can be done, how is it done?
Thankyou
Ed

Tim Williams

Create or change color of a (line with arrow head) with a Macro en
 

With ActiveSheet.Shapes.AddLine(240#, 190.5, 432#, 191.25)
.Line.EndArrowheadStyle = msoArrowheadTriangle
.Line.EndArrowheadLength = msoArrowheadLengthMedium
.Line.EndArrowheadWidth = msoArrowheadWidthMedium
.Name = "myLine"
End With

With ActiveSheet.Shapes("myLine")
.Line.ForeColor.RGB = RGB(255, 0, 0)
End With

Tim

--
Tim Williams
Palo Alto, CA


"Ed" wrote in message
...
Hi
Can an item (a line with arrowhead as created by the Drawing function for
example) be created and/or the color of it changed by an entry or

entries
in a Macro when certain conditions exist?
If this can be done, how is it done?
Thankyou
Ed




Ed

Create or change color of a (line with arrow head) with a Macr
 
Hi Tim
Thanks for the good information. My test Macro tells me I am on the right
track.
I looked for further help on this area of programming in the "Excel Help" on
my computer. I could not find any. Where can I find more information on
this area of programming (such as the line appears properly, but is protected
and can't be removed or replaced with the Macro. Also, information on the
placement of the line and colors.)
I think I need an advanced programming handbook.
Is this information available on the internet?
Or where is one available?
Thanks again
Ed

"Tim Williams" wrote:


With ActiveSheet.Shapes.AddLine(240#, 190.5, 432#, 191.25)
.Line.EndArrowheadStyle = msoArrowheadTriangle
.Line.EndArrowheadLength = msoArrowheadLengthMedium
.Line.EndArrowheadWidth = msoArrowheadWid

thMedium
.Name = "myLine"
End With

With ActiveSheet.Shapes("myLine")
.Line.ForeColor.RGB = RGB(255, 0, 0)
End With

Tim

--
Tim Williams
Palo Alto, CA


"Ed" wrote in message
...
Hi
Can an item (a line with arrowhead as created by the Drawing function for
example) be created and/or the color of it changed by an entry or

entries
in a Macro when certain conditions exist?
If this can be done, how is it done?
Thankyou
Ed





Tim Williams

Create or change color of a (line with arrow head) with a Macr
 
Did you look in help from Excel or from the VB editor ?

I don't know why the line would be protected. Maybe you could show the code
you have so far ?

Lots of VBA help available on the web (searhc Google and you'll find plenty
of tutorials) or in this newsgroup.

Tim

--
Tim Williams
Palo Alto, CA


"Ed" wrote in message
...
Hi Tim
Thanks for the good information. My test Macro tells me I am on the right
track.
I looked for further help on this area of programming in the "Excel Help"

on
my computer. I could not find any. Where can I find more information on
this area of programming (such as the line appears properly, but is

protected
and can't be removed or replaced with the Macro. Also, information on the
placement of the line and colors.)
I think I need an advanced programming handbook.
Is this information available on the internet?
Or where is one available?
Thanks again
Ed

"Tim Williams" wrote:


With ActiveSheet.Shapes.AddLine(240#, 190.5, 432#, 191.25)
.Line.EndArrowheadStyle = msoArrowheadTriangle
.Line.EndArrowheadLength = msoArrowheadLengthMedium
.Line.EndArrowheadWidth = msoArrowheadWid

thMedium
.Name = "myLine"
End With

With ActiveSheet.Shapes("myLine")
.Line.ForeColor.RGB = RGB(255, 0, 0)
End With

Tim

--
Tim Williams
Palo Alto, CA


"Ed" wrote in message
...
Hi
Can an item (a line with arrowhead as created by the Drawing function

for
example) be created and/or the color of it changed by an entry or

entries
in a Macro when certain conditions exist?
If this can be done, how is it done?
Thankyou
Ed








All times are GMT +1. The time now is 10:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com