运行 excel 宏中的时间错误 424
Run time error 424 in excel macros
我是 excel 宏的新手,我正在创建一个需要格式化单元格并为 A 列生成条形码的宏。创建了一个函数 Code128() 来转换字符串输入 blog 中给出的条形码,它工作正常。
我在创建的宏中使用它们,如下所示
With ActiveSheet.PageSetup
.PrintTitleRows = ":"
.PrintGridlines = True
.Orientation = xlLandscape
.PaperSize = xlPaperA4
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
End With
Columns("A").ColumnWidth = 10
For Each Target In Range("A1", Range("A" & Rows.Count).End(xlUp))
If Target.Value <> vbNullString Then
Target.Value = PERSONAL.XLSB!Code128(Target.Value)
Target.Resize(, 12).WrapText = True
Target.Font = "Code 128"
End If
Next
Next
但是当我 运行 excel 上的宏时,我收到 运行 时间错误,例如
您应该能够使用 Application.Run
计算另一个工作簿中存在的函数。其格式为:
Target.Value = Application.Run("PERSONAL.XLSB!Module2.Code128", Target.Value)
或者更一般地说:
= Application.Run(workbookname$ & "!" & modulename & "." & functionname, args())
除此之外,您可以 在 Book1 中。
我是 excel 宏的新手,我正在创建一个需要格式化单元格并为 A 列生成条形码的宏。创建了一个函数 Code128() 来转换字符串输入 blog 中给出的条形码,它工作正常。
我在创建的宏中使用它们,如下所示
With ActiveSheet.PageSetup
.PrintTitleRows = ":"
.PrintGridlines = True
.Orientation = xlLandscape
.PaperSize = xlPaperA4
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
End With
Columns("A").ColumnWidth = 10
For Each Target In Range("A1", Range("A" & Rows.Count).End(xlUp))
If Target.Value <> vbNullString Then
Target.Value = PERSONAL.XLSB!Code128(Target.Value)
Target.Resize(, 12).WrapText = True
Target.Font = "Code 128"
End If
Next
Next
但是当我 运行 excel 上的宏时,我收到 运行 时间错误,例如
您应该能够使用 Application.Run
计算另一个工作簿中存在的函数。其格式为:
Target.Value = Application.Run("PERSONAL.XLSB!Module2.Code128", Target.Value)
或者更一般地说:
= Application.Run(workbookname$ & "!" & modulename & "." & functionname, args())
除此之外,您可以