在Excel的VBA中,可以使用以下函数来获取当前操作的单元格坐标,并获取计算隔壁单元格的坐标:

vbaPrivate Sub Worksheet_Change(ByVal Target As Range)
    Dim currentCell As Range
    Set currentCell = Target

    Dim currentRow As Integer
    currentRow = currentCell.Row

    Dim currentColumn As Integer
    currentColumn = currentCell.Column

    Dim neighborCell As Range
    Set neighborCell = Cells(currentRow + 1, currentColumn) '假设邻居单元格在下一行同一列End Sub

这个函数是放在Excel的VBA编辑器中的Worksheet模块下,当工作表中的任何单元格内容发生改变时,它都会执行。

在这个函数中,我们首先使用Target来获取当前发生改变的单元格,然后使用currentCell变量来引用它。接着,我们使用Row和Column属性来获取当前单元格的行号和列号,并将其分别赋值给currentRow和currentColumn变量。

然后,我们使用Cells函数和currentRow、currentColumn变量来获取下一行同一列的单元格,将其赋值给neighborCell变量。接着,我们使用Row和Column属性来获取邻居单元格的行号和列号,并将其分别赋值给neighborRow和neighborColumn变量。