需要VBA错误代码对象---进行了三重检查,但仍然无法正常工作 [英] VBA Error Code Object Required --- Have Triple checked but still not working

查看:70
本文介绍了需要VBA错误代码对象---进行了三重检查,但仍然无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的粗体和斜体行继续向我返回运行时错误'424':必需的对象.我正在将此作为自学课程的一部分进行研究,并且我已经进行了三倍的检查以确保我正在输入代码正确,并且仍在返回此错误.我尝试在此处查看此错误的其他示例,但由于我对代码的了解不够,因此对本实例无济于事.

The Bold and Italicized lines below continue to return to me the "Run Time Error'424': Object Required. I am working on this as part of a self learn class, and I have tripled checked to make sure I am entering the code properly and am still returning this error. I tried looking at other examples of this error on here, but none were helpful to this instance because I do not know the code well enough yet.

谢谢!

Sub FirstArray()

Dim Fruit(2) As String

Fruit(0) = "Apple"
Fruit(1) = "Banana"
Fruit(2) = "Cherry"
***Range("A1").Text = "First Fruit: " & Fruit(1)***

Dim Veg(1 To 3) As String

Veg(1) = "Artichoke"
Veg(2) = "Broccoli"
Veg(3) = "Cabbage"
***Range("B1").Text = "First Veg:" & Veg(1)***

Dim Flower() As String
ReDim Flower(1 To 3)

Flower(1) = "Azalea"
Flower(2) = "Buttercup"
Flower(3) = "Crocus"
***Range("C1").Text = "Final Flower:" & Flower(3)***





End Sub

推荐答案

您只需要将.Text更改为.Value

这篇关于需要VBA错误代码对象---进行了三重检查,但仍然无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆