嗨,我需要有人帮我在Excel 2007上执行此方案:)
所以这是场景:
点击 commandButton1后 ,
所以每当我输入另一个代码时,例如QZ0822(sheet1),然后在我点击按钮后,它会自动在包含QZ0822(sheet2)的单元格旁边添加“Ok”。
我可以这样做吗?
答案 0 :(得分:0)
像这样吗?
Sub lookup()
Dim strSearch As String
Dim wks1 As Worksheet
Dim wks2 As Worksheet
Set wks1 = Sheets("Your Sheet 1") '<--- fill in your sheet name
Set wks2 = Sheets("Your Sheet 2") '<--- fill in your sheet name
strSearch = wks1.Range("B3").Value
With wks2
.Columns(2).Find(strSearch).Offset(0, 1).Value = "Ok"
End With
End Sub