代码中的运行时错误424用于连接广告标题 [英] Runtime error 424 in code to concatenate ad titles
问题描述
您好,
我正在尝试使用4列6个条目创建广告标题,将所有4列连接成唯一的组合。我找到了一个教程,为了做到这一点,并在开始lrow的行上得到运行时424错误。我使用的是Excel 2016 32bit版本
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
我尝试了什么:
这是一个相对简单的代码,但我怀疑它可能适用于早期版本的Excel 。我不知道该尝试什么。
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.
推荐答案
我怀疑它可能是早期版本的Excel。
I suspect that it may be for an earlier version of Excel.
这不是真的。
要解决您的问题,请阅读此内容:需要对象(错误424)| Microsoft Docs [ ^ ]
第一眼看来,好像是 lrow
变量未初始化(或小于1)。您可以使用调试器轻松检测它。请参阅:在Excel VBA中调试 - Easy 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[^]
这篇关于代码中的运行时错误424用于连接广告标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!