Link to home
Start Free TrialLog in
Avatar of Shanan212
Shanan212Flag for Canada

asked on

Application Defined or Object defined error

Set BaseWks = ActiveSheet

Sheets("GL Summary").Range("A1:G").CurrentRegion.Name = "Ranges"

Open in new window


Hi,

I am getting the 'Application Defined or Object defined error' on above line.

Using examples in this forum, I tried this

Set BaseWks = ActiveSheet

basewks.Range("A1:G").CurrentRegion.Name = "Ranges"

Open in new window


Then it gave me, 'method range of object worksheet failed' error :o

Any help is much appreicated!
I am trying to assign the region as an array for my dynamic pivot table!

Thanks!


Avatar of StephenJR
StephenJR
Flag of United Kingdom of Great Britain and Northern Ireland image

Try thus:
basewks.Range("A1").CurrentRegion.Name = "Ranges"

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Shanan212
Shanan212
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Shanan212

ASKER

this works now
Perhaps you can get in the habit of testing things before you ask the question.