View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Subrouines and graphics in VBA

VBA can pretty much issue all the command you can do manually. If you turn
on the macro recorder, then create your chart manually, then turn off the
macro recorder, it will give you a good start on the code you need to build a
chart. (delete the chart and run the code).

You call a subroutine by using call

Call macro2()

or just put in

Macro2

Sub Main()
macro1
macro2 "hello Bob"
macro2 "How are you"
End sub

Sub Macro1()
msgbox "in macro1"
end sub

Sub Macro2(a as String)
msgbox "in macro2, " & a
End Sub

http://msdn.microsoft.com/office/und...d/default.aspx

http://www.mvps.org/dmcritchie/excel/getstarted.htm

http://www.mvps.org/dmcritchie/excel....htm#tutorials
links to VBA tutorials follow links to general Excel tutorials

--
Regards,
Tom Ogilvy



"stuart" wrote:

I'm using VBA (Visual Basic 6.3) in Excel 2002.

Can I use VBA to write a program that is made up from a series of
subroutines, or the VBA equivalent? I remember using CALL in FORTRAN years
ago, but what is the corresponding VBA syntax?

Also, can VBA produce simple graphics (this could be a little difficult to
explain). For example as an output from a VBA program a simple diagram is
produced, such as lines, 2-D planes and cylinders. I'm not sure if VBA has
any graphics abilities.

Thanks.