Extract Cell Contents to String

  • Thread starter Thread starter arm9047
  • Start date Start date
A

arm9047

Via a textbox, the user enters the two columns to be graphed against each
other. In the 4th row of each column is the column name. I need to extract
these column names to label the x and y axis of the graph.

Thanks so much!
 
You say A textbox, does that mean you have both column references in the one
text box value? If so how do you differentiate them, is it by a separator
value (comma maybe?) or something else?
 
Two text boxes, the inputs are put into two separate variables xAxis and yAxis.
 
Assumes textbox 1 and 2 are on the same sheet as the chart, no checking that
the users enters a valid column reference (letter), change chart reference
to suit.

With ActiveSheet
.ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlValue, xlPrimary).AxisTitle.Text = .Cells(4,
..TextBox1.Value)
ActiveChart.Axes(xlCategory, xlPrimary).AxisTitle.Text = .Cells(4,
..TextBox2.Value)
End With

--

Regards,
Nigel
(e-mail address removed)
 

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

Back
Top