ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro--userinput (https://www.excelbanter.com/excel-programming/352863-macro-userinput.html)

hurriancep

Macro--userinput
 

I should write a macro to get the data range from user.
Now I am using "Inputbox" to obtain the range of data.
However, I thnk it is unconvinient.
So could I get the range by highlighting the related cells by using
macro.


--
hurriancep
------------------------------------------------------------------------
hurriancep's Profile: http://www.excelforum.com/member.php...o&userid=31358
View this thread: http://www.excelforum.com/showthread...hreadid=510518


Robert ap Rhys

Macro--userinput
 

"hurriancep" wrote
in message ...

I should write a macro to get the data range from user.
Now I am using "Inputbox" to obtain the range of data.
However, I thnk it is unconvinient.
So could I get the range by highlighting the related cells by using
macro.

Use Application.InputBox and set the Type parameter to 8

Robert



[email protected]

Macro--userinput
 
Hi
Use a Userform with a RefEdit control from the Control Toolbox. This
allows you to select a range using the mouse while the form is visible.
The value of the RefEdit control is the address selected as a string
which you can use in code as Range(SelectionString) for example.

regards
Paul

hurriancep wrote:
I should write a macro to get the data range from user.
Now I am using "Inputbox" to obtain the range of data.
However, I thnk it is unconvinient.
So could I get the range by highlighting the related cells by using
macro.


--
hurriancep
------------------------------------------------------------------------
hurriancep's Profile: http://www.excelforum.com/member.php...o&userid=31358
View this thread: http://www.excelforum.com/showthread...hreadid=510518




All times are GMT +1. The time now is 12:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com