简体   繁体   English

VBA-Excel 宏

[英]VBA-Excel Macro

Please help me to solve this.请帮我解决这个问题。 Once I run this VBA macro it shows an error mentioning the Application-defined or object define error.一旦我运行这个 VBA 宏,它就会显示一个错误,提到应用程序定义或 object 定义错误。

Code:代码:

Sub income_status()
Dim i As Integer

For i = 1 To 10
  Cells(i, 0) = ActiveCell.Value

  If Cells(i, 0) <= 10000 Then
    Cells(i, 1) = "Low Income"
  ElseIf Cells(i, 0) > 10000 And Cells(i, 0) <= 50000 Then
    Cells(i, 1) = "Medium Income"
  Else
    Cells(i, 1) = "High Income"
  End If    
Next i

End Sub

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM