+ Reply to Thread
Results 1 to 3 of 3

Doesn't recognize worksheet

  1. #1
    davegb
    Guest

    Doesn't recognize worksheet

    Sub CountReasonContactCode()
    Dim Wksht As Worksheet
    Dim rReason As Range
    Dim lRow As Long
    Dim lCurRow As Long
    Dim rCell As Range
    Dim l16Rct As Long
    Dim l16Act As Long
    Dim l16BGct As Long
    Dim lCt As Long
    Dim lTotNameRow As Long



    lRow = 107
    lTotNameRow = 4
    l16Rct = 0
    l16Act = 0
    l16BGct = 0

    For Each Wksht In ActiveWorkbook <---ERROR

    Doesn't recognize method or property error
    Any suggestions?
    Thanks!


  2. #2
    Jim Thomlinson
    Guest

    RE: Doesn't recognize worksheet

    Give this a try...

    For Each Wksht In ActiveWorkbook.Worksheets
    --
    HTH...

    Jim Thomlinson


    "davegb" wrote:

    > Sub CountReasonContactCode()
    > Dim Wksht As Worksheet
    > Dim rReason As Range
    > Dim lRow As Long
    > Dim lCurRow As Long
    > Dim rCell As Range
    > Dim l16Rct As Long
    > Dim l16Act As Long
    > Dim l16BGct As Long
    > Dim lCt As Long
    > Dim lTotNameRow As Long
    >
    >
    >
    > lRow = 107
    > lTotNameRow = 4
    > l16Rct = 0
    > l16Act = 0
    > l16BGct = 0
    >
    > For Each Wksht In ActiveWorkbook <---ERROR
    >
    > Doesn't recognize method or property error
    > Any suggestions?
    > Thanks!
    >
    >


  3. #3
    George Nicholson
    Guest

    Re: Doesn't recognize worksheet

    A Worksheet is not a member of Workbook (Workbook isn't a collection and has
    no members).
    A Worksheet is a member of the ActiveWorkbook.Worksheets collection.

    For Each Wksht In ActiveWorkbook.Worksheets

    HTH,
    --
    George Nicholson

    Remove 'Junk' from return address.


    "davegb" <[email protected]> wrote in message
    news:[email protected]...
    > Sub CountReasonContactCode()
    > Dim Wksht As Worksheet
    > Dim rReason As Range
    > Dim lRow As Long
    > Dim lCurRow As Long
    > Dim rCell As Range
    > Dim l16Rct As Long
    > Dim l16Act As Long
    > Dim l16BGct As Long
    > Dim lCt As Long
    > Dim lTotNameRow As Long
    >
    >
    >
    > lRow = 107
    > lTotNameRow = 4
    > l16Rct = 0
    > l16Act = 0
    > l16BGct = 0
    >
    > For Each Wksht In ActiveWorkbook <---ERROR
    >
    > Doesn't recognize method or property error
    > Any suggestions?
    > Thanks!
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1