This isn't how you define names. You don't need to use any VBA at all. Try
it this way.
Say your data starts in A1, where cell A1 itself is blank, but you have
dates from A2 downward. O, H, L, and C are in columns B through E. (If your
data is elsewhere, adjust the steps below.)
Use the Insert menu > Names > Define dialog to create the following names:
Name: TheDates
Refers To: =OFFSET(A1,1,0,COUNT(A:A),1)
Name: TheOpen
Refers To: =OFFSET(TheDates,0,1)
Name: TheHigh
Refers To: =OFFSET(TheDates,0,2)
Name: TheLow
Refers To: =OFFSET(TheDates,0,3)
Name: TheClose
Refers To: =OFFSET(TheDates,0,4)
Select the data range you currently have and make your chart. The series
formula for the Open series looks like:
=SERIES(Sheet1!$B$1,Sheet1!$A$2:$A$20,Sheet1!$B$2:$B$20,1)
Edit this so it reads:
=SERIES(Sheet1!$B$1,Sheet1!TheDates,Sheet1!TheOpen,1)
Similarly:
=SERIES(Sheet1!$B$1,Sheet1!TheDates,Sheet1!TheHigh,2)
=SERIES(Sheet1!$B$1,Sheet1!TheDates,Sheet1!TheLow,3)
=SERIES(Sheet1!$B$1,Sheet1!TheDates,Sheet1!TheClose,4)
Now if you have done this correctly, it will update whether data is added or
removed.
Actually, as I stated, creating a List is even easier, but you didn't seem
to want to try that.
- Jon