View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
IsaBeL IsaBeL is offline
external usenet poster
 
Posts: 13
Default Select range with InputBox. Is it possible?

Hello!

I posted yesterday because I needed help to select ranges to make a chart
with a macro, and I have another question related with this.
I thought I always knew in what columns my x and y values where but it may
not be true.
What I need is to ask the user with an input box to tell me what is the
first cell of data to my x and y values, and then use these values to select
the ranges for the graph, instead of selecting always the same ranges.

x_cell = InputBox("Insert the first cell of data for x values, e.g A8")
y_cell = InputBox("Insert the first cell of data for y values, e.g B8")

Range("A10").Select
Set x_values = Range("A10", Range("A10").End(xlDown))
Set y_values = x_values.Offset(0, 1)

Is it possible? How?
Thank you very much for your help.

Best regards,

Isabel