ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Displaying range value when range name is concatenated (https://www.excelbanter.com/excel-discussion-misc-queries/117625-displaying-range-value-when-range-name-concatenated.html)

Barb Reinhardt

Displaying range value when range name is concatenated
 
I have this in cell A1:

="PlanMonth" & row()
I'd like to display the range name that matches "PlanMonth1". How do I do
that?

Gary''s Student

Displaying range value when range name is concatenated
 
Sub missive()
s = InputBox("enter range name: ")
MsgBox (Range(s).Address)
End Sub
--
Gary's Student


"Barb Reinhardt" wrote:

I have this in cell A1:

="PlanMonth" & row()
I'd like to display the range name that matches "PlanMonth1". How do I do
that?


Barb Reinhardt

Displaying range value when range name is concatenated
 
I guess I wasn't clear with my question.

I'd like to display the value of the range that has the following range name
="PlanDate" & 1
for example.
How do I do that?

"Gary''s Student" wrote:

Sub missive()
s = InputBox("enter range name: ")
MsgBox (Range(s).Address)
End Sub
--
Gary's Student


"Barb Reinhardt" wrote:

I have this in cell A1:

="PlanMonth" & row()
I'd like to display the range name that matches "PlanMonth1". How do I do
that?


Dave Peterson

Displaying range value when range name is concatenated
 
Dim TestRng as range

set testrng = nothing
on error resume next
set testrng = "PlanDate" & "1"
on error goto 0

if testrng is nothing then
'not a valid range name
else
msgbox testrng.cells(1).value
end if

You have another response at your earlier thread, too.

Barb Reinhardt wrote:

I guess I wasn't clear with my question.

I'd like to display the value of the range that has the following range name
="PlanDate" & 1
for example.
How do I do that?

"Gary''s Student" wrote:

Sub missive()
s = InputBox("enter range name: ")
MsgBox (Range(s).Address)
End Sub
--
Gary's Student


"Barb Reinhardt" wrote:

I have this in cell A1:

="PlanMonth" & row()
I'd like to display the range name that matches "PlanMonth1". How do I do
that?


--

Dave Peterson

Barb Reinhardt

Displaying range value when range name is concatenated
 
Dave,

I've not used "Evaluate" often for ranges. Are there times when it's
required?

Thanks

"Dave Peterson" wrote:

Dim TestRng as range

set testrng = nothing
on error resume next
set testrng = "PlanDate" & "1"
on error goto 0

if testrng is nothing then
'not a valid range name
else
msgbox testrng.cells(1).value
end if

You have another response at your earlier thread, too.

Barb Reinhardt wrote:

I guess I wasn't clear with my question.

I'd like to display the value of the range that has the following range name
="PlanDate" & 1
for example.
How do I do that?

"Gary''s Student" wrote:

Sub missive()
s = InputBox("enter range name: ")
MsgBox (Range(s).Address)
End Sub
--
Gary's Student


"Barb Reinhardt" wrote:

I have this in cell A1:

="PlanMonth" & row()
I'd like to display the range name that matches "PlanMonth1". How do I do
that?


--

Dave Peterson


Dave Peterson

Displaying range value when range name is concatenated
 
I didn't use evaluate in this code. I don't think I've ever used it to retrieve
a value from a range. But I have used it to get the value from a name.

But in the other thread, I wanted to show the difference between the
evaluate(...value) and just .value.

(=2000 and 2000, for instance)

Barb Reinhardt wrote:

Dave,

I've not used "Evaluate" often for ranges. Are there times when it's
required?

Thanks

"Dave Peterson" wrote:

Dim TestRng as range

set testrng = nothing
on error resume next
set testrng = "PlanDate" & "1"
on error goto 0

if testrng is nothing then
'not a valid range name
else
msgbox testrng.cells(1).value
end if

You have another response at your earlier thread, too.

Barb Reinhardt wrote:

I guess I wasn't clear with my question.

I'd like to display the value of the range that has the following range name
="PlanDate" & 1
for example.
How do I do that?

"Gary''s Student" wrote:

Sub missive()
s = InputBox("enter range name: ")
MsgBox (Range(s).Address)
End Sub
--
Gary's Student


"Barb Reinhardt" wrote:

I have this in cell A1:

="PlanMonth" & row()
I'd like to display the range name that matches "PlanMonth1". How do I do
that?


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 12:17 AM.

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