Excel VBA - Use an existing string in called sub -


I already ask for so much apologies

I am halfway through a userform and in Excel I'm trying to make some big cuts with my code using the call - I have 12 buttons which all do the same thing, the only difference is that each button is subtly dependent on the sub-button caption is . My problem is that I do not already understand a way to use the string declared in the button sub, then use it in the sub-sub I know that you can do this, but my Google skills do not fail me (

Can anyone show me how to do this? Hopefully everyone understands ...

My code has a very small snippet , But you get jist:

  public subcommand Tone 4_click () String name as the dim name = CommandButton4. Caption call sort 1 and all`  

and another (tried to do it as a function for testing and error )

  Public Sub-order 1 (name as string) Label11 caption = name sheet (name).  << code>   

You are passing an argument for the other substrin or function. First of a string There is a sample of: -

  function leftOne (string as string) in the form of a string LeftOne = Left (StrSample, 1) Termination function  

A BOVE function can be used within another function or suburban areas if you meet its requirement: Argument field of the StrSample function By declaring StrSample as String , you get the original The form requires that any call for this be string must be passed

the string as the full line LeftOne (string as the string) < / Code> can be read: "I am doing LeftOne function. Give me a string and I'll 'return' to a string after doing something with it. Note that the name StrSample is an arbitrary name.

Anyway, the above is as simple to call:

  SubMsgInABox () Dim StrToFeed as String StuffFeed = "BK 201" MSBBC Lieuten (Stratophid) 'Return B & Sbs'  

In your example, if you select Name < Code> want to pass sort 1 , your effort is absolutely correct.

Let us know that it helps.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -