'Range' set by userform

J

JB2010

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
 
M

merjet

This could be done w/o a UserForm.

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

Hth,
Merjet
 
M

merjet

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top