开发者

How to fix "Compile Error: Object Required" error?

开发者 https://www.devze.com 2023-01-31 07:16 出处:网络
This is my开发者_开发知识库 very first time with VBA. For the following code fragment: Dim i As Integer

This is my开发者_开发知识库 very first time with VBA. For the following code fragment:

Dim i As Integer
    Set i = 0
    For Each v In dictDT.Keys
        Cells(10, 5 + i) = dictDT.Item(v)
        i = i + 1
    Next

I keep getting this error:

Compile Error: Object Required

What am I doing wrong?


Change

Set i = 0

to

i = 0

Only objects require the Set keyword. Other variable types do not.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号