LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default VARIABLES AGAIN

I have a problem with string variables:

I have created this button in an Excel sheet to which I have attached a Macro.
When I bring out the Programming code, it shows projects and modules. The
real program is in the module and it is called by an expression €œCall Macro1€
found in the projects section of the spreadsheet.
I am creating about 40 Macro buttons which will have to do the same
procedure but with 2 different variables changing with every button. These
are string variables.
Thus far I have done the following:

In the Project sheet these are my lines:

Private Sub CommandButton1_Click()
S$ = "7A"
N$ = "B3"
Call Macro1
End Sub

In the Macro (in the module €“ the procedure), I have used the following
lines:
Sheets(S$).Select
Range(N$).Select

But it gives me an error while executing.
I have tried putting the variable assignments in the same Macro1, and it
works. But that doesnt solve anything for me.
As I guess it, the variable values are not passing from the Project sheet to
the Macro.

I have even tried to use another Macro2 and place my variable assignments
there. Calling Macro2 first and then Macro1. It still doesnt work.

Any solution to this problem? I am in a hurry guys.
Please Help. I am new to this.

Regards.

 
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
Not at all clear on use of variables and/or object variables JMay-Rke Excel Discussion (Misc queries) 11 July 4th 08 06:36 PM
Storing variables in a macro and using those variables to performcalculations. [email protected] Excel Programming 3 December 10th 07 04:13 PM
VBA Variables.... MarkHear1 Excel Programming 12 February 15th 07 02:34 PM
Variables No Name Excel Programming 2 July 9th 04 05:37 AM
DIm Variables Todd Huttenstine Excel Programming 4 April 26th 04 04:37 PM


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

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

About Us

"It's about Microsoft Excel"