Variable in Macro?

  • Thread starter Thread starter JVLennox
  • Start date Start date
J

JVLennox

Hi everybody,

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

I have a little Macro, that counts lines with certain Elements in
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 Su
-------------------


Now, instead of ELEMENT as one of the criteria above, I would like t
have the _content_of_the_cell_A3__of the active worksheet as
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!!!

JVLenno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top