Current Selection = Object

  • Thread starter Thread starter whicks
  • Start date Start date
W

whicks

I'm trying to set a relative reference as an "object" in VBA.

Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select

I want this to be my "Object"

Should I Say;

Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select = Object

?????

Or;

ActiveSheet.UsedRange.Select = Object
 
I'm not sure I understand what you're doing, but possibly:

Dim obj As Object
Set obj = ActiveSheet.UsedRange

or, usually better:

Dim rng As Range
Set rng = ActiveSheet.UsedRange
 

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