LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default Dim statements in VBA

Thanks, that's helpful.

Dave
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"JE McGimpsey" wrote:

Dim is a keyword used to declare variables, and one cannot assign value
to the variable in the Dim statement.

Constants are declared using the Const keyword, and *must* have a value
assigned.

Const csPASSWORD As String = "drowssap"
Dim sPWORD As String

sPWORD = csPASSWORD

In article ,
Dave F wrote:

Is it correct to refer to a Dim statement as a variable? See the following
macro and comments:

Sub ToggleInterestRate()
Dim Toggle As String
'Defines Toggle as a variable
Toggle = InputBox("Enter Y or N to toggle interest rate calculation")
'Defines the variable Toggle as equaling the value entered in the
pop up.
Worksheets(1).Range("A3").Value = Toggle
'Applies the value specified as Toggle in the cell A3

I guess what I'm asking is: is there ever a case where a Dim statement is
NOT variable; i.e., is a constant?


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
If Statements sherobot Excel Worksheet Functions 0 March 28th 07 09:28 PM
IF Statements (Mutliple Statements) Deezel Excel Worksheet Functions 3 October 19th 06 06:13 AM
if and or statements Debbie via OfficeKB.com Excel Discussion (Misc queries) 4 June 13th 06 02:24 PM
IF & AND statements hip Excel Worksheet Functions 5 June 7th 06 11:36 PM
If then statements David Bryant Excel Worksheet Functions 3 June 5th 06 10:41 PM


All times are GMT +1. The time now is 08:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"