ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Defining a variable within a sub... (https://www.excelbanter.com/excel-programming/316442-defining-variable-within-sub.html)

aking1987[_2_]

Defining a variable within a sub...
 

Code
-------------------

Sub EXAMPLe
Dim cellalphanumber As String
If SomeCondition=True Then
EXAMPLE1
cellalphanumber = "E"
Else
EXAMPLE1
cellalphanumber = "D"
End If

END SUB

SUB EXAMPLE1

msgbox cellalphanumber
END SU
-------------------

can you see where my problem is

--
aking198
-----------------------------------------------------------------------
aking1987's Profile: http://www.excelforum.com/member.php...fo&userid=1539
View this thread: http://www.excelforum.com/showthread.php?threadid=27731


NickHK

Defining a variable within a sub...
 
aking1987,
No, what is your problem ?

NickHK

"aking1987" wrote in message
...

Code:
--------------------

Sub EXAMPLe
Dim cellalphanumber As String
If SomeCondition=True Then
EXAMPLE1
cellalphanumber = "E"
Else
EXAMPLE1
cellalphanumber = "D"
End If

END SUB

SUB EXAMPLE1

msgbox cellalphanumber
END SUB
--------------------

can you see where my problem is?


--
aking1987
------------------------------------------------------------------------
aking1987's Profile:

http://www.excelforum.com/member.php...o&userid=15393
View this thread: http://www.excelforum.com/showthread...hreadid=277313





All times are GMT +1. The time now is 04:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com