ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   'Range' set by userform (https://www.excelbanter.com/excel-programming/384543-range-set-userform.html)

JB2010

'Range' set by userform
 
Hi


i currently have a macro that resizes the Y axis of a chart based on numbers
in two cells. at the moment these cells are static, so i can set up the macro
with an actual cell reference in the coding. soon I am going to have send
this out to others who may move the cells which feed this macro.

I was wondering if i could make a userform that would, having clicked to
start the macro, ask the user to input the two cell references where the
information for new axis size can be found.

i have used user forms before & obviously have a currently ok macro, i just
cant work out how i transform my existing macro so its populated with the
specific info from a userform.

any help gratefully received. let me know if you need more info.


cheers


jb

merjet

'Range' set by userform
 
This could be done w/o a UserForm.

Set rng = Application.InputBox("Highlight two cells with Y-axis
info.", Type:=8)

Hth,
Merjet



merjet

'Range' set by userform
 
You could offer default cells, too.

Set rng = Application.InputBox("Highlight two cells with Y-axis
info.", Default:="Sheet1!B4:B5", Type:=8)

Hth,
Merjet



JB2010

'Range' set by userform
 
Cheers merjet

worked a treat

jb

"merjet" wrote:

You could offer default cells, too.

Set rng = Application.InputBox("Highlight two cells with Y-axis
info.", Default:="Sheet1!B4:B5", Type:=8)

Hth,
Merjet





All times are GMT +1. The time now is 01:08 PM.

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