The problem
I just want to the A2 cell to say Exam Mailers for (current month) (current year)
. Example: Exam Mailers for April 2020
if I do:
Range("a2").Value = "Exam Mailers for " + (months(i))
It works and I get
Exam Mailers for April
BUT if I do:
Range("a2").Value = "Exam Mailers for " + (months(i)) + " " + Year(Now)
it fails with
Run-time error `13`: Type mismatch
Here is the full code so far:
Sub datechange_1()
Dim months(11) As String
months(0) = "Janurary"
months(1) = "Feburary"
months(2) = "March"
months(3) = "April"
months(4) = "May"
months(5) = "June"
months(6) = "July"
months(7) = "August"
months(8) = "September"
months(9) = "October"
months(10) = "November"
months(11) = "December"
Dim nowMonth As Integer
nowMonth = Month(Now)
For i = 0 To 11
If nowMonth = (i + 1) Then
Range("a2").Value = "Exam Mailers for " + (months(i)) + " " + Year(Now)
End If
Next
End Sub
Any ideas or suggests are appreciated. Thanks!