首页 > 解决方案 > VBA问题,将值影响到excel列

问题描述

我试图通过 VBA 在 excel 中开发一个函数,我写了下面的语法,但它总是错误的(我不知道为什么)!错误消息说:Else Cells.Value(i, 2) not correct , please if语法有问题帮我改正

Dim i As Integer
i = 2
   While Cells(i, 1).Value <> 0
      If Cells(i, 1).Value = Cells(i - 1, 1).Value Then 
      Cells(i, 2).Value = 0
      Else
      Cells(i, 2).Value
      End If
    i = i + 1
   Wend

标签: excelvba

解决方案


推荐阅读