Forum Discussion

perkin_warbeck's avatar
perkin_warbeck
Brass Contributor
Aug 08, 2021
Solved

How do I select a discontinuous named range in Excel?

I have a named range that is discontinuous. For example, 

 

discontinuous=Sheet1!$C$3:$C$4,Sheet1!$D$3:$D$5

 

(the actual range in my application is more complicated).

 

In VBA, I can easily select this range:

 

Dim discontinuous As Range
Set discontinuous = Range("discontinuous")
discontinuous.Select

 

I would like to be able to do the same thing efficiently in Excel. By "efficiently," I mean without all the clicking, shift clicking, control clicking, etc. Is it possible? It seems like something that should be possible to do in Name Manager.

 

 

  • I found the answer. In the name box, select the name. This automatically selects the range.

    I expected to find a similar feature in Name Manager.

3 Replies

  • I found the answer. In the name box, select the name. This automatically selects the range.

    I expected to find a similar feature in Name Manager.
  • Vedran_Loani's avatar
    Vedran_Loani
    Copper Contributor

    perkin_warbeck  Excel's Name Manager could be used for this, just give that range of cells a custom name and refer to it in Excel's formulas (i.e. SUM(discontinuous)), check this:

     

    https://martinbosanacvba.blogspot.com/2021/08/referring-to-cells-using-name-manager.html 

    • perkin_warbeck's avatar
      perkin_warbeck
      Brass Contributor
      I know how to refer to a named range in a formula. I simply want to select the range for a copy or paste. In other words, I want to do the equivalent of

      discontinuous.Select

      Except I want to do it in Excel.

Resources