Function generateHeader(sDate As String) As String
Dim i As Integer
ReDim arrMonthes(1 To 12)
arrMonthes = Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
Set rRng = xlSheet.Range("C4:N4")
For i = 0 To 11
If Right(sDate, 3) = arrMonthes(i) Then
For Each rCell In rRng.Cells
rCell.Value = arrMonthes(i)
Next rCell
Exit For
End If
Next
end function
Sample scenario
Excel
C:4 to N:4
nag generate ako ng for the month of FEB
gusto ko po sana mag backdate so dapat magging FEB to JAN na po ung nsa excel
Salamat po sa makakatulong
Dim i As Integer
ReDim arrMonthes(1 To 12)
arrMonthes = Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
Set rRng = xlSheet.Range("C4:N4")
For i = 0 To 11
If Right(sDate, 3) = arrMonthes(i) Then
For Each rCell In rRng.Cells
rCell.Value = arrMonthes(i)
Next rCell
Exit For
End If
Next
end function
Sample scenario
Excel
C:4 to N:4
nag generate ako ng for the month of FEB
gusto ko po sana mag backdate so dapat magging FEB to JAN na po ung nsa excel
Salamat po sa makakatulong