LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Jeff
 
Posts: n/a
Default VBA passing variables through a function

I have a macro

Sub TestMacro(X,Y)
....calculations based on X and Y values
End Sub

By putting the "X,Y" in the macro, does this make it a function. Because
when I try to look for the macro using the macro button on the toolbar the
function "TestMacro" does not show up. It shows up when I remove the X,Y.
Do you know what has changed? Also i this a good way to program, I want to
be able to input values for X and Y so I thought this would be good since I
wouldn't have to keep changing the "TestMacro".

Sub macro1()
X = 7
Y=5
Call TestMacro(X,Y)
End sub
 
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
Passing parameters Cel Ref) to Sum function Shamshad Butt Excel Discussion (Misc queries) 4 October 26th 05 10:46 AM
Changing worksheet cells from within a function James4U2enjoy Setting up and Configuration of Excel 1 October 14th 05 02:16 PM
Passing variables between a form and macro David New Users to Excel 1 October 5th 05 04:42 AM
Can I use variables in a Range function? André - Brazil Excel Discussion (Misc queries) 2 May 5th 05 10:39 PM
HOW CAN I GET OFFICE 2003 EXCEL BASIC TO NEST FUNCTIONS LIKE EXCE. Robert AS Excel Worksheet Functions 4 December 2nd 04 10:49 AM


All times are GMT +1. The time now is 07:12 AM.

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"