View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
J_J J_J is offline
external usenet poster
 
Posts: 58
Default Count all VLOOKUP() functions on worksheet

Hi David,
I find out with your code that
SearchFormat:=
is not recognized with XL2K
any suggestions?
TIA

"David" wrote in message
...
Hi Golzill,
This assumes there is at least two instances of a Vlookup. Z is the

counter
and it will start out in "A1" and look forward from there. It starts out

with
Z set to 0, but it will go through the loop and end up at the first "Find"
and count it again.

Sub Macro1()
Range("A1").Select
Cells.Find(What:="=VLOOKUP", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
StartAddress = ActiveCell.Address
Z = 0
Do
Cells.FindNext(After:=ActiveCell).Activate
Z = Z + 1
Loop While ActiveCell.Address < StartAddress
End Sub


"golzilla" wrote:


How can I count all the VLOOKUP() functions on an active worksheet using
VBA?

Thank you very much for the help!


--
golzilla
------------------------------------------------------------------------
golzilla's Profile:

http://www.excelforum.com/member.php...o&userid=16789
View this thread:

http://www.excelforum.com/showthread...hreadid=319863