I'm trying to setup a QC chart that has a "Mean" line. I can do this simply when making the chart manually by entering (as example) $A$1,$A$1 into the "Y Values" field for the series. Well I'm trying to write code that will update the charts series ranges based on selections made from Data Validation cells on the sheet. So the ranges will change depending on the selections. I know how to use .Cells inside the .Range, but when I do that, it creates a range of cells, rather than 2 individual cell references. How can I reference 2 separate cells? Here's what I've got so far:
I can set it up as a string easy enough, but that doesn't help me when I'm trying to set the range for the Y Values. tRNG breaks.
Code:
Sub TestRNG()
Dim tRNG As Range
Dim tString As String
Set tRNG = Worksheets("QC Limits").Range(Worksheets("QC Limits").Cells(1, 1) _
, Worksheets("QC Limits").Cells(1, 1) _
& "," & Worksheets("QC Limits").Cells(1, 1) _
, Worksheets("QC Limits").Cells(1, 1))
tString = Worksheets("QC Limits").Cells(1, 1).Address _
& "," & Worksheets("QC Limits").Cells(1, 1).Address
MsgBox tString
End Sub
I can set it up as a string easy enough, but that doesn't help me when I'm trying to set the range for the Y Values. tRNG breaks.