View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] brotherescott@yahoo.com is offline
external usenet poster
 
Posts: 18
Default Determine the text in a range that covers several cells

I defined a name on a sheet that refers to the combined cells A1-A3. I
can set it to a text string but I can not read back what it contains.
Here is a snipit of my code that sets the value and then tries to test
what is stored in it.
I would appreciate any help in figuring out how to get the value of
this named range.
Thanks
Scott

Sub Test()
'LName is the combined range on the worksheet of cells A1 to A3
Worksheets("Sheet1").Range("LName") = "Anderson"
'Test to see what "LName" is
If Worksheets("Sheet1").Range(LName).FormulaR1C1 < "" Then MsgBox
"Yes"
If Worksheets("Sheet1").Range(LName).Value < "" Then MsgBox "Yes"
If Worksheets("Sheet1").Range(LName).Text < "" Then MsgBox "Yes"
If Worksheets("Sheet1").Range("LName").FormulaR1C1 < "" Then
MsgBox "Yes"
If Worksheets("Sheet1").Range("LName").Value < "" Then MsgBox
"Yes"
If Worksheets("Sheet1").Range("LName").Text(1) < "" Then MsgBox
"Yes"
End Sub