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/316428-defining-variable-within-sub.html)

aking1987

Defining a variable within a sub...
 

Is it possible to define a variable, say "cellalphanumber" as "D" a
part of the ELSE within an if then else statement.

So if its ELSE it will define cellalphanumber = D

Can this definition be used within another sub

--
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,
Do you mean:
Dim cellalphanumber As String
If SomeCondition=True Then
cellalphanumber = "Something Else"
Else
cellalphanumber = "D"
End If

NickHK

"aking1987" wrote in message
...

Is it possible to define a variable, say "cellalphanumber" as "D" as
part of the ELSE within an if then else statement.

So if its ELSE it will define cellalphanumber = D

Can this definition be used within another sub?


--
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 08:43 AM.

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