The commented lines below continue to return to me the error Run Time Error'424': Object Required
. I am working on this as part of a self learn class, and I have tripled checked to make sure I am entering the code properly and am still returning this error. I tried looking at other examples of this error on here, but none were helpful to this instance because I do not know the code well enough yet.
Thank you!
Sub FirstArray()
Dim Fruit(2) As String
Fruit(0) = "Apple"
Fruit(1) = "Banana"
Fruit(2) = "Cherry"
Range("A1").Text = "First Fruit: " & Fruit(1)
' ^ RUN TIME ERROR 424
Dim Veg(1 To 3) As String
Veg(1) = "Artichoke"
Veg(2) = "Broccoli"
Veg(3) = "Cabbage"
Range("B1").Text = "First Veg:" & Veg(1)
' ^ RUN TIME ERROR 424
Dim Flower() As String
ReDim Flower(1 To 3)
Flower(1) = "Azalea"
Flower(2) = "Buttercup"
Flower(3) = "Crocus"
Range("C1").Text = "Final Flower:" & Flower(3)
' ^ RUN TIME ERROR 424
End Sub
You just need to change .Text
to .Value