Non-contiguous selection

  • Thread starter Thread starter PBezucha
  • Start date Start date
P

PBezucha

In the recent, cancelled question I asked Dave Peterson
how to select the range for later defining
SeriesCollection in the xy-chart:

With ActiveSheet
Set Rng1 = .Range(.Range(.Cells(1, 2), .Cells(N, 2)), _
.Range(.Cells(1, 6), .Cells(N, 6)))
End With

It really worked well as far as the columns were
contiguous. As soon as the columns were distant (as in the
example), all the area was selected, and a number of
excessive curves appeared. The problem is how to adapt the
range definition so that only two relevant columns are
taken.
Many thanks to any adviser.

Petr
 
Hi
you can use Union in VBA for this to combine to non contingenous ranges
 

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