首页 > 解决方案 > 目标搜索功能中的“编译错误:需要对象”

问题描述

我正在尝试自动化Goalseek 功能。

Sub Goalseek()
Dim rw As Integer
Dim cl As Integer

Set rw = ActiveCell.Row
cl = ActiveCell.Column
To_value = Cells(rw, cl - 25).Value

Cells(rw, cl + 6).Goalseek Goal:=To_value, ChangingCell:=Cells(rw, cl)

End Sub

编译错误:需要对象

出现。

标签: excelvba

解决方案


推荐阅读