Selecting A Range

P

Patrick Molloy

Dim rTable As Range
Dim WS As Worksheet
Set WS = ActiveSheet

Set rTable = WS.Cells.CurrentRegion

Now you have rTable in memory referencing the sheet
region. Don't forget that you can manipulate data easily
without necessarily having the sheet active nor the cells
selected. The code above works whatever sheet is active.

Patrick Molloy
Microsoft Excel MVP
 

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

Top