Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am trying to create ad headlines using 4 columns of 6 entries to concatenate all 4 columns into unique combinations. I found a tutorial in order to do this and am getting the runtime 424 error on the line starting "lrow". I am using Excel 2016 32bit version

For i = 2 To 7
    For j = 2 To 7
        For k = 2 To 7
            For l = 2 To 7
                lrow = Sheet2.Cells(Rows.Count, 1).End(xlUp).Row + 1
                Sheet2.Cells(lrow, 1).Value = Sheet1.Cells(i, 1).Value & " " & Sheet1.Cells(j, 2).Value & " " & Sheet1.Cells(k, 3).Value & " " & Sheet1.Cells(l, 4).Value
            Next
        Next
    Next
Next


What I have tried:

This is a relatively simple code but I suspect that it may be for an earlier version of Excel. I am not sure what to try.
Posted
Updated 21-Sep-18 5:10am

1 solution

Quote:
I suspect that it may be for an earlier version of Excel.

It's not true.

To resolve your issue, please read this: Object required (Error 424) | Microsoft Docs[^]

On the first look, it seems lrow variable is not initialized (or it's less than 1). You can easy detect it by using debugger. See: Debugging in Excel VBA - Easy Excel Macros[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900