macros to create symbols

  • Thread starter Thread starter kramlys
  • Start date Start date
K

kramlys

I have a set of symbols to use in flow charts. Instead of clicking on the
drawing tool bar to create the symbols, I am trying to write some macros in
such a way that I will have buttons which I will just press and the symbols
will be created according to the respectively button that I will press.
Example pressing button A creates symbol A
 
something like:

Sub AddRectangle()
With Selection
ActiveSheet.Shapes.AddShape msoShapeRectangle, .Left, .Top, .Width,
..Height
End With
End Sub

one for each shape, then link them to the buttons.
 
The one line macro below add a rectangle to the worksheet. the rectangle is a
standard shape. yo could do the same with clip art or a custom symbol that
you create.

If you are looking to add a character sysmbol then use this code. To run the
macro you have to get out of the text entry mode (typing characters into a
cell) to run the button. I'm adding the degree sign.

Private Sub CommandButton2_Click()
ActiveCell.Value = ActiveCell.Value & "°"
End Sub
 
Back
Top