SeanJ
08-18-2008, 07:39 AM
Hello again folks.
I have a combo box that has FY from current year - 2 through current year +3.
I am trying to put on a worksheet a whole FY year.
example:
Oct-07 through Sep-08
Based of the ComboFY value.
Option Explicit
Dim xDate As String 'convert date picker year to string
Dim ydate As Integer 'convert string to integer
Dim dteDate As Integer 'integer year
Dim TemDate As Integer 'for next loop counter
Private Sub ComboFding_Change()
xDate = Format(DTPicker.Value, "yy")
ydate = xDate
ydate = ydate - 2
dteDate = ydate + 3
For TemDate = ydate To dteDate
If TemDate <= 9 Then
ComboFY.AddItem Format(TemDate, "0#")
Else
ComboFY.AddItem Format(TemDate, "##")
End If
Next TemDate
End Sub
I have a combo box that has FY from current year - 2 through current year +3.
I am trying to put on a worksheet a whole FY year.
example:
Oct-07 through Sep-08
Based of the ComboFY value.
Option Explicit
Dim xDate As String 'convert date picker year to string
Dim ydate As Integer 'convert string to integer
Dim dteDate As Integer 'integer year
Dim TemDate As Integer 'for next loop counter
Private Sub ComboFding_Change()
xDate = Format(DTPicker.Value, "yy")
ydate = xDate
ydate = ydate - 2
dteDate = ydate + 3
For TemDate = ydate To dteDate
If TemDate <= 9 Then
ComboFY.AddItem Format(TemDate, "0#")
Else
ComboFY.AddItem Format(TemDate, "##")
End If
Next TemDate
End Sub