Automatic List Numbering in VBA Code Giving Error Plz Help

Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Automatic List Numbering in VBA Code Giving Error Plz Help

  1. #1
    Board Regular
    Join Date
    Nov 2003
    Posts
    267
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Automatic List Numbering in VBA Code Giving Error Plz Help

     
    I am using the following code to enter the automatic list numbers

    [B7:B10].Formula = "=IF(C7<>"",COUNTA($C$7:C7),"")"

    but its giving me the error

    Runtime Error 1004
    Application Defined or Object Defined Error

    Help will be appreciated


    Regards



    Mazher

  2. #2
    MrExcel MVP mikerickson's Avatar
    Join Date
    Jan 2007
    Location
    Davis CA
    Posts
    21,371
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Automatic List Numbering in VBA Code Giving Error Plz Help

    It's probably the double quotes before closing the parenthesis.
    Code:
    Range("B7:b10").FormulaR1C1 = "=IF(RC[1]<>"""",COUNTA(R7C3:RC[1]),"""")"

  3. #3
    Board Regular
    Join Date
    Nov 2003
    Posts
    267
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Automatic List Numbering in VBA Code Giving Error Plz Help

      
    Dear mikerickson

    Your code is working fine

    Range("B7:b10").FormulaR1C1 = "=IF(RC[1]<>"""",COUNTA(R7C3:RC[1]),"""")"

    Now this one is giving error

    FinalRow = Range("F65536").End(xlUp).Row
    TotalRow = FinalRow + 1
    Range("b7:b" & TotalRow).FormulaR1C1 = "=IF(RC[1]<>"""",COUNTA(R7C3:RC[1]),"""")"

    Runtime Error 404
    Object Required

    I have data in columns C to F the data starts from row 7

    Cell B6 = "SNo."

    I want to add the automatic list numbering formula from cells B7 to downward till the data in the columns C to F

    I also dont want to show the formulas in cell B7 downward I want to paste Special Values insted of formula.


    Please help



    Regards



    Mazher

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com