This UserForm displays calculated values from a datasheet with several hundred rows. Range A is the date.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
I’m attempting to reduce the ComboBox list to only the data rows for the current month. So, if today is 2/15/11, ComboBox1 offers only Feb dates.
Do I need to add a "Select Month" Combobox?<o></o>
<o></o>
Any help with the code to accomplish this is appreciated.<o></o>
<o></o>
<o></o>
I’m attempting to reduce the ComboBox list to only the data rows for the current month. So, if today is 2/15/11, ComboBox1 offers only Feb dates.
Do I need to add a "Select Month" Combobox?<o></o>
<o></o>
Any help with the code to accomplish this is appreciated.<o></o>
<o></o>
Rich (BB code):
Private Sub UserForm_Initialize()<o:p></o:p>
Dim x&<o:p></o:p>
With Sheets("Sheet1")<o:p></o:p>
For x = 2 To .Cells(Rows.Count, "A").End(xlUp).Row<o:p></o:p>
ComboBox1.AddItem (.Range("A" & x).Value)<o:p></o:p>
Next x<o:p></o:p>
End With<o:p></o:p>
End Sub
Private Sub ComboBox1_Change()
TextBox1.Value = (Format(Range("T" & ComboBox1.ListIndex + 2) + Range("U" & ComboBox1.ListIndex + 2) * 0.25, "$ #.00"))<o:p></o:p>
TextBox2.Value = (Format(Range("V" & ComboBox1.ListIndex + 2) + Range("W" & ComboBox1.ListIndex + 2) * 0.25, "$ #.00"))<o:p></o:p>
TextBox3.Value = (Format(Range("X" & ComboBox1.ListIndex + 2) + Range("Y" & ComboBox1.ListIndex + 2) * 0.25 + Range("Z" & ComboBox1.ListIndex + 2), "$ #.00"))<o:p></o:p>
TextBox5.Value = (Format(Range("AE" & ComboBox1.ListIndex + 2), "$ #.00"))<o:p></o:p>
TextBox6.Value = (Format(Range("AF" & ComboBox1.ListIndex + 2), "$ #.00"))<o:p></o:p>
TextBox7.Value = (Format(Range("AD" & ComboBox1.ListIndex + 2), "$ #.00"))<o:p></o:p>
TextBox8.Value = (Format(Range("AG" & ComboBox1.ListIndex + 2), "$ #.00"))<o:p></o:p>
TextBox9.Value = (Format(Range("AH2"), "$ #.00"))
End Sub<o:p></o:p>