I have the following code:
Dim CurrMonth As Integer
Dim MonthPos As Variant
Dim CurrPos As Integer
CurrMonth = Month(Date) - 1
MonthPos = Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
Could anyone provide guidance on how I would be able to get (in this case) the string element from the Array MonthPos given the index CurrMonth.
>Solution :
https://www.softwaretestinghelp.com/vba-array-tutorial/#One_Dimensional_Array offers following example:
Private Sub arrayExample3()
Dim thirdQuarter(13 To 15) As String 'creates array with index 13,14,15
thirdQuarter(13) = "July"
thirdQuarter(14) = "Aug"
thirdQuarter(15) = "Sep"
MsgBox "Third Quarter in calendar " & " " & thirdQuarter(13) & " " &
thirdQuarter(14) & " " & thirdQuarter(15)
End Sub
So for your case should be:
MonthPos(CurrMonth)