Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting CONST referencing a cell Value
I've been trying to enter
CONST celladdress as STRING = sheets("mysetup").Range("E13").value ' E13 on my sheet mysetup contains the value "G1" (without the quotes) I'can't seem to accomplish this. Am I doing something wrong? TIA, Jim |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting CONST referencing a cell Value
Hi Jim,
You can only assign a constant value to a Constant. You could use: Const sStr As String = "A" But you cannot use: Const sStr2 As String = Range("A1").Value 'or Const sStr As String = Chr(65) Try instead: Dim cellAddress As String cellAddress = Sheets("mysetup").Range("E13").Value --- Regards, Norman "JMay" wrote in message ... I've been trying to enter CONST celladdress as STRING = sheets("mysetup").Range("E13").value ' E13 on my sheet mysetup contains the value "G1" (without the quotes) I'can't seem to accomplish this. Am I doing something wrong? TIA, Jim |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting CONST referencing a cell Value
Thanks Norman;
Seems like a small price to pay by using: Dim cellAddress As String cellAddress = Sheets("mysetup").Range("E13").Value Thanks, Jim May "Norman Jones" wrote: Hi Jim, You can only assign a constant value to a Constant. You could use: Const sStr As String = "A" But you cannot use: Const sStr2 As String = Range("A1").Value 'or Const sStr As String = Chr(65) Try instead: Dim cellAddress As String cellAddress = Sheets("mysetup").Range("E13").Value --- Regards, Norman "JMay" wrote in message ... I've been trying to enter CONST celladdress as STRING = sheets("mysetup").Range("E13").value ' E13 on my sheet mysetup contains the value "G1" (without the quotes) I'can't seem to accomplish this. Am I doing something wrong? TIA, Jim |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
public const availability? | Excel Programming | |||
relative path for const in vba code | Excel Programming | |||
Not recognizing a Const | Excel Programming | |||
Public Const on a Drive | Excel Programming | |||
crash changing const to public const | Excel Programming |