Ok I really need help with the following issue that I have</SPAN>
I have a sheet called DATA which contains lists of data , like name, title, dates, etc… , ROW C contains lists of dates</SPAN>
My User Interface asks users to select two dates</SPAN>
Date 1, and Date 2 , and then hit submit button ( I already have these done which works fine )</SPAN>
Now what doesn’t work :</SPAN>
the submit button needs to go look at the date 1 and date 2 (which are being populated inside textbox after user select the date) and compare to ROW C in the DATA sheet and if it find anything in between the dates use those dates to Populate GRAPH</SPAN>
I already have the graph VBA code , all I need is the code to compare the dates and find all matching dates in the ROW C, and whatever it find there sign it to a string and pass it to the graph… so here is portion of code , please let me know how to fix this. THANK YOU</SPAN>
I have a sheet called DATA which contains lists of data , like name, title, dates, etc… , ROW C contains lists of dates</SPAN>
My User Interface asks users to select two dates</SPAN>
Date 1, and Date 2 , and then hit submit button ( I already have these done which works fine )</SPAN>
Now what doesn’t work :</SPAN>
the submit button needs to go look at the date 1 and date 2 (which are being populated inside textbox after user select the date) and compare to ROW C in the DATA sheet and if it find anything in between the dates use those dates to Populate GRAPH</SPAN>
I already have the graph VBA code , all I need is the code to compare the dates and find all matching dates in the ROW C, and whatever it find there sign it to a string and pass it to the graph… so here is portion of code , please let me know how to fix this. THANK YOU</SPAN>
Code:
Private Sub btn_Graph_Click()</SPAN>
D1 = CDate(txtDate1.Value)</SPAN>
D2 = CDate(txtDate2.Value)</SPAN>
If D1 > D2 Then</SPAN>
MsgBox ("Date 1 Should be Smaller than Date 2 , Please fix")</SPAN>
Exit Sub</SPAN>
Else</SPAN>
End If</SPAN>
If D1 = D2 Then</SPAN>
MsgBox ("Date 1 Can't be Equal Date 2 , Please fix")</SPAN>
Exit Sub</SPAN>
Else</SPAN>
GoTo 99</SPAN>
End If</SPAN>
99 </SPAN>
‘ HERE IS THE SECTION I HAVE NO IDEA HOW TO DO</SPAN>
If ActiveCell.Value > D1 And ActiveCell.Value < D2 Then</SPAN>
‘ HERE IS THE SECTION I HAVE NO IDEA HOW TO DO</SPAN>
xRequestorECD = "='Data'!$C$2:$C$13"</SPAN>
xAssigneeECD = "='Data'!$J$2:$J$13"</SPAN>
xCompleted = "='Data'!$P$2:$P$13"</SPAN>
ActiveSheet.Shapes.AddChart.Select</SPAN>
ActiveChart.ChartType = xlXYScatterSmooth</SPAN>
ActiveChart.SeriesCollection.NewSeries</SPAN>
ActiveChart.SeriesCollection(1).Name = "Requestor ECD"</SPAN>
' ActiveChart.SeriesCollection.(1)XValues = xRow</SPAN>
‘ ActiveChart.SeriesCollection(1).Values = rrty</SPAN>
ActiveChart.SeriesCollection.NewSeries</SPAN>
ActiveChart.SeriesCollection(2).Name = "Assignee ECD"</SPAN>
' ActiveChart.SeriesCollection(2).XValues = "='Data'!$Q$2:$Q$9" ' & xRow</SPAN>
ActiveChart.SeriesCollection(2).Values = xAssigneeECD</SPAN>
ActiveChart.SeriesCollection.NewSeries</SPAN>
ActiveChart.SeriesCollection(3).Name = "Completed"</SPAN>
ActiveChart.SeriesCollection(3).Values = xCompleted</SPAN>
‘ so if I can assign a string to found data a a range then I can pass it to my graph , if you know what I mean.</SPAN>
Is there anyone out there to help me ? I am new to this VBA thing and I know it should be easy but I can’t figure it out</SPAN>
With ActiveChart.Parent</SPAN>
.Height = 225 ' resize</SPAN>
.Width = 400 ' resize</SPAN>
.Top = 108 ' reposition</SPAN>
.Left = 50 ' reposition</SPAN>
End With</SPAN>
Exit Sub</SPAN>
End If</SPAN>
End Sub</SPAN>