View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Pass Variable to another Sub

Here is an alternative approach:

Sub dural()
Dim s1 As String, s2 As String, s3 As String
s1 = "QWERTY"
s2 = "poiuy"
s3 = "MJUYT"
Call littleguy(s1, s2, s3)
End Sub


Sub littleguy(a As String, b As String, c As String)
MsgBox (a & b & c)
End Sub
--
Gary''s Student - gsnu200770


"CSUS_CE_Student" wrote:

Hey everyone, i need some help. I am trying to pass a variable to another
sub. I will need to pass 3-4 variables total, so if my example wont allllow
for this please let me know what i need to do. I did look at other posts
but was not able to find something that worked ( or i didnt know it would).
Im not that knowegable in programing.

Sub Wall()
Dim WallEl As Single
WallEl = Range("a1").Value
End Sub

Sub NextWall()
Range("a2") = WallEl
End Sub


Thanks for your help in advance

jared