PPRuNe Forums

PPRuNe Forums (https://www.pprune.org/)
-   Computer/Internet Issues & Troubleshooting (https://www.pprune.org/computer-internet-issues-troubleshooting-46/)
-   -   Macros in Excel ...... ? (https://www.pprune.org/computer-internet-issues-troubleshooting/261676-macros-excel.html)

Oggin Aviator 27th Jan 2007 12:05

Macros in Excel ...... ?
 
Hi

Can someone explain how to design and put a macro in excel that can help automatically draw arrows of specific lengths and fill colours?

TIA

Oggin

Glen Livid 23rd Feb 2007 00:15

Go to Menu: Tools/Macro/Record New Macro and draw sample arrows and then format as required, then stop macro recording.

Press Alt + F8 (or Menu: Tools/Macro/Macros) and choose Edit and you will see the macro you have just recorded. You can edit the macro's AddLine Method to change the arrows as required. When you want to run the modified macro you can hit Alt + F8, select the macro and choose Run. You could also assign the macro to a button on your worksheet or to a new toolbar or menu command.

AddLine Method Example:
This example adds a blue dashed line to myDocument.
Set myDocument = Worksheets(1)
With myDocument.Shapes.AddLine(10, 10, 250, 250).Line
.DashStyle = msoLineDashDotDot
.ForeColor.RGB = RGB(50, 0, 128)
End With


All times are GMT. The time now is 17:22.


Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.