View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
rocketslinger[_7_] rocketslinger[_7_] is offline
external usenet poster
 
Posts: 1
Default Exctracting Literal Value From A String Variable


Thank you for the response, but I thought I could get my answer by
keeping it simple.

What I am trying to do is dynamically create my Range argument as my
sheet changes and the only way that I know how to do that is through
the use of strings. For example if I programmmatically create the
following variables and fill them with the associated strings (which
could be longer):

Dim r1, r2, r3, r4 As String

r1 = "Range(Cells(RowPointer0, ColumnPointer1), Cells(RowPointer1,
ColumnPointer1))"
r2 = "Range(Cells(RowPointer0, ColumnPointer2), Cells(RowPointer1,
ColumnPointer2))"
r3 = "Range(Cells(RowPointer0, ColumnPointer3), Cells(RowPointer1,
ColumnPointer3))"
r4 = "Range(Cells(RowPointer0, ColumnPointer4), Cells(RowPointer1,
ColumnPointer4))"

How can I pass the literal value of these strings for use in lets say,

Dim rng As Range
Set rng = Union(r1, r2, r3, r4)
rng.Select

Maybe this is a little clearer. Thanks.


--
rocketslinger
------------------------------------------------------------------------
rocketslinger's Profile: http://www.excelforum.com/member.php...fo&userid=4093
View this thread: http://www.excelforum.com/showthread...hreadid=519956