Userform using RefEdit to get a range

LisaGreen
5StarLounger
Posts: 964
Joined: 08 Nov 2012, 17:54

Userform using RefEdit to get a range

Post by LisaGreen »

Hello everyone,

This is a form, and a sub to use it, to get a range from an excel sheet.

It uses RefEdit and is all VBA and no API thingies. I was intrigued by someones attempts to do this so here is my attempt.

You can easily add the xlsm as an add in or add the code and form it to you own add-in code.

At the moment it returns a string but could equally well return an object like "selection".

If anyone has any problems with it please get back to me!!

Regards
Lisa
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78483
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Userform using RefEdit to get a range

Post by HansV »

1) I noticed that I cannot switch to another open workbook.

2) I get an error when I click Cancel:
S0015.png
smRange should be smGetRange (multiple times).
I had to crash Excel to get out of this.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

LisaGreen
5StarLounger
Posts: 964
Joined: 08 Nov 2012, 17:54

Re: Userform using RefEdit to get a range

Post by LisaGreen »

Hans!!!

Thank you!!!!... And many sorries!

Working on it!

Happy Christmas my lovely friend!

Lisa

LisaGreen
5StarLounger
Posts: 964
Joined: 08 Nov 2012, 17:54

Re: Userform using RefEdit to get a range

Post by LisaGreen »

Here's a new copy!!!

Tested this as much as I can.

Many apologies for the previous one!

Lisa
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78483
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Userform using RefEdit to get a range

Post by HansV »

That works better!
Best wishes,
Hans

LisaGreen
5StarLounger
Posts: 964
Joined: 08 Nov 2012, 17:54

Re: Userform using RefEdit to get a range

Post by LisaGreen »

Phew!!!!!