0

I am trying to parse data from sheet1 into an array then printing it to another worksheet. I get an object required error, but from what I can gather from msdn is that my object types are wrong for the array but when I switch the array from string to variant I get a mismatch error instead. What can I do to fix the object required 424 error? Here's the code:

Private Sub Enter2_Click()
    'Define Variables
    Dim MatchRow As Integer
    Dim data() As String
    Dim row As Integer
    Dim col As Integer
    Dim dataInfo As String

    Worksheets("Sheet1").Activate
    'Match Name To A Row
    MatchRow = WorksheetFunction.Match(RName.Value, Range("A1:A100"), 0)

    For i = 0 To 22
        Worksheets("Sheet1").Activate
        Cells(MatchRow, i + 3).Select
        data = Split(ActiveCell.Value, ".")

        Worksheets("Reporting template").Activate
        Cells(20, 1).Select
        ActiveCells.Value = data(0)  'This is where the error pops up at
        ActiveCells.Offset(0, 1).Select
        ActiveCells.Value = data(1)
        ActiveCells.Offset(0, 1).Select
        ActiveCells.Value = data(2)
        ActiveCells.Offset(0, 1).Select
        ActiveCells.Value = data(3)
    Next i
End Sub
0

1 Answer 1

1

Is ActiveCells an object you have defined anywhere? Usually to refer to the active cell we use ActiveCell. No s.

Sign up to request clarification or add additional context in comments.

1 Comment

Rofl I must have done that while copying and pasting. Thank you so much!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.