小编Asi*_*sim的帖子

Excel VBA 输入框 - 选择范围(类型 8)但不是固定范围,即 A1 不是 $A$1

我目前在我的VBA代码中有以下行Inputbox

Set myValues = Application.InputBox("Please select on the spreadsheet the first cell in the column with the values that you are looking for:", Type:=8)

但是,当我选择单元格时,它会自动输入例如$A$1. 这是否可以更改,而无需用户手动删除 $,以便Inputbox自动选择单元格引用为A1

它是自动VLookup宏的一部分,除了VLookup整列中固定的值之外,它完美地工作。

提前致谢。

更新 - 这是完整的代码:

Dim FirstRow As Long
Dim FinalRow As Long
Dim myValues As Range
Dim myResults As Range
Dim myCount As Integer

Sub VlookupMacroNew()  

Set myValues = Application.InputBox("Please select on the spreadsheet the first cell in …
Run Code Online (Sandbox Code Playgroud)

lookup excel vba inputbox

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

excel ×1

inputbox ×1

lookup ×1

vba ×1