在 VBA 中使用查找后更改单元格的列

Changing the column of cell after using find in VBA

我正在使用 Selection.find 在列中查找特定值。找到值后,我想要单元格右侧的单元格中的值。

我正在以这种方式使用 find 查找单元格:

Set cell = Selection.Find(What:=ValueIWantToFind, After:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False)

我正在尝试在找到单元格后更改它的列,如下所示:

 cell.Column = cell.Column + 1

但它给我一个 运行-Time Error '450':

Wrong number of arguments or invalid property assignment.

如何更改单元格的列?

这会给你右边的单元格

 cell.Offset(,1).Value

这给出了右边的单元格。

cell.Offset(0, 1).Value