Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think I must be stupid, as I have read lots of information and am not
getting the point. I am very used to declaring variables as follows: sub whatever() dim strSht4Name As String strSht4Name = "nameofsheet4" end sub I have 2 questions: 1) Can I combine the 2 rows i.e. dim strSht4Name As String = "nameofsheet4" 2) As I now also better understand going "public" I would like to do the following: Public strSht4Name As String strSht4Name = "nameofsheet4" But am informed by excel that the second line where I pass a value to the variable is not correct outside a sub. Is this correct or am I doing something wrong? Thanks for the help and advice (It would be good if this got better coverage in the books us lesser mortals purchase) Richard |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sum if 2 variables | Excel Discussion (Misc queries) | |||
Not at all clear on use of variables and/or object variables | Excel Discussion (Misc queries) | |||
Storing variables in a macro and using those variables to performcalculations. | Excel Programming | |||
Variables in VBA | Excel Programming | |||
SUM IF and two variables | Excel Worksheet Functions |