Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Subrouines and graphics in VBA

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Subrouines and graphics in VBA

Sub Test1()
Msgbox "In Test1"
Test2
Msgbox "Back in Test1"
End Sub

Sub Test2()
Msgbox "In Test2"
End Sub

You can use shapes for simple graphics - see the drawing toolbar. Draw some shapes while recording a macro to get some idea of what
you code might look like.

--
Tim Williams
Palo Alto, CA


"stuart" wrote in message ...
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Subrouines and graphics in VBA

Make the drawing toolbar visible under View=Toolbars

then look at the autoshapes and construct you diagram.

After you have it down, turn on the macro recorder and do it again to see
how the code works.

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote:

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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Graphics Jordan Excel Programming 1 November 27th 06 02:55 PM
Graphics won kevinla Excel Discussion (Misc queries) 0 November 20th 06 06:36 PM
Bug with graphics NehalemLabs Excel Discussion (Misc queries) 0 June 13th 06 05:58 PM
VBA - graphics Bruce Williams[_3_] Excel Programming 0 April 27th 04 11:51 PM
Graphics alexm999[_17_] Excel Programming 1 January 31st 04 04:12 AM


All times are GMT +1. The time now is 04:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"