Home > Software engineering >  Excel VBA referenced in the Match function why wrong? And references to other function is no problem
Excel VBA referenced in the Match function why wrong? And references to other function is no problem

Time:11-13

 
Public Sub TEST_LIST2 ()
Dim temp_sum As Integer
Dim temp_TK_Col As Integer

Temp_sum=WorksheetFunction. Sum (Sheet6. Range (" A1: D5 "))
Sheet6. Cells (3, 1)=temp_sum
Temp_TK_Col=WorksheetFunction. Match (Sheet6. Cells (1, 1), Sheet3. Range (" 1 "), 0)
Sheet6. Cells (2, 1)=temp_TK_Col

End Sub


Why the Sum function reference no problem, but the Math function will prompt "runtime error 1004, cannot achieve class WorksheetFunction. Match attribute"???????

CodePudding user response:

Check your "Sheet6. Cells (1, 1)," is there any value, I tried it on, if the cell is empty, this place would be an error, if there is value, the normal operation
  •  Tags:  
  • VBA
  • Related