+ Reply to Thread
Results 1 to 4 of 4

doesn't recognize the variable

  1. #1
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    doesn't recognize the variable

    Why doesn’t it recognize the variable iUniqIdCells?

    WORKS: Range(Cells(2, iCurntCol), Cells(iLastRow, iCurntCol)).Select
    FAILS: Range("iUniqIdCells").Select

    I want to count the entries in Range W2:W89 and put the total into W1
    My ActiveCell.Formula doesn’t work
    Please Login or Register  to view this content.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Carstowal,

    This code will place the COUNTA formula in W1 using the cells W2 through W89.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686
    the " " marks are messing it up

    I don't understand what your code is doing but it puts the argument in ""
    =COUNTA("$W$2:$W$89")in W1

    which returns 1 (it should return 33)
    and it would return 33 if the " " was omitted from the formula, yielding =COUNTA($W$2:$W$89) in W1

    what does Addx = Chr$(34) & Selection.Address & Chr$(34) mean?

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Carstowal,

    My apologies for that. I should have checked the COUNTA argument type. Use this code instead...

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

+ 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