construct range?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a single cell range named StartRange.
I would like to construct a multi-cell range named TestRange.
The first cell of TestRange would be StartRange and the last cell of
TestRange would be StartRange.Row + RowInteger, StartRange.Column +
ColumnInteger

Dim StartRange As Range
Dim TestRange As Range
Dim RowInteger As Integer
Dim ColumnInteger As Integer

Set StartRange ActiveCell
RowInteger = 4
ColumnInteger = 5

'Doesn't work
Set TestRange = Range(StartRange,
Range(StartRange).Item(RowInteger,ColumnInteger))

Please help
Thanks Jeff Higgins
 
Try something like

set TestRange=Union(StartRange, AnotherRange)

Tim.
 
Dim StartRange As Range
Dim RowInteger As Integer
Dim ColumnInteger As Integer
Dim TestRange As Range

Set StartRange ActiveCell
RowInteger = 4
ColumnInteger = 5

'Does work but seems convoluted
Set TestRange = Range(StartRange.Address, _
Application.Cells(StartRange.Row + RowInteger, _
StartRange.Column + ColumnInteger).Address))
 
Maybe

Set TestRange = Range(ActiveCell,
ActiveCell.offset(RowInteger,ColumnInteger))

I'm not exactly sure what range you're trying to obtain, but this
would give you a rectangular range with the activecell being topleft,
and the bottom right cell being RowInteger cells down and
Columninteger cells to the right.

Tim
 
Tim,
yes, the range I have been seeking is as you say.
offset method, of course!!!
Thanks for your help, much appreciated.
Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top