Link to home
Start Free TrialLog in
Avatar of Rayne
RayneFlag for United States of America

asked on

Excel resize range via VBA

Hello,

I have a named range – first_Range. I have two buttons –

Abbreviate - restores the named range to B3:C7
Expand – expands the range to include B3:C11

Now recording macro and doing this doesn’t solves the problem as I am having issues in the vba code.
Is there a VBA code that does that – resizing the range according to the button pressed…
For example, ihis one is not working….

Worksheets(Sheet2).(Range("first_Range").Rows.Count, 1).Resize.Name = "first_Range"


Thank you
resizeVBA.xlsm
ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

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 Rayne

ASKER

How about…. I say that your code works great :) Thank you Sir