View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Variable in Macro?

not tested but try

InStr(zeile, "ELEMENT")

InStr(zeile, range("a1") & " ")
--
Don Guillett
SalesAid Software

"JVLennox" wrote in
message ...

Hi everybody,

this is probably not the most challenging question for you, but still I
don't know how to do it (Newbie).

I have a little Macro, that counts lines with certain Elements in a
logfile:

Code:
--------------------
Sub LogDateiLesen()
Dim zeile, anz ' zeile means line
Open "C:\Log.txt" For Input As 1
While Not EOF(1)
Line Input #1, zeile
If InStr(zeile, "ELEMENT") 0 And InStr(zeile, "pubid-601311277") 0
Then anz = anz + 1
Wend
Close
Cells(5, 4) = anz 'cell D5
End Sub
--------------------


Now, instead of ELEMENT as one of the criteria above, I would like to
have the _content_of_the_cell_A3__of the active worksheet as a
criteria.
PLUS this content shall be followed by an additional space.
So I guess I have to define a variable....?
How do I have to put it into that code??

THANKS SO MUCH!!!

JVLennox


--
JVLennox
------------------------------------------------------------------------
JVLennox's Profile:
http://www.excelforum.com/member.php...o&userid=32505
View this thread: http://www.excelforum.com/showthread...hreadid=563078