+ Reply to Thread
Results 1 to 3 of 3

for every line I browse make a count and post this count in a cell (fiouuu)

  1. #1
    Registered User
    Join Date
    03-29-2013
    Location
    milan
    MS-Off Ver
    Excel 2007
    Posts
    4

    for every line I browse make a count and post this count in a cell (fiouuu)

    Hello,

    All starts in the column R
    For every line in this column (precisely from line R13 to R56)
    I am trying to count the columns not empty from colum X to column AB and this for each row.
    And for each count Ido I would like to post the result for this line in the column R.

    Theres nothing better than a good example=)

    For example:
    Starts at R13 and checks from X13 to AB13 how many Cells are filled (not empty). And then post the number (the count) in R13.
    Then on R14 it checks from X14 to AB14 how many Cells are filled. And then post the number (the count) in R14.
    Then on R15 it checks from X15 to AB15 how many Cells are filled. And then post the number (the count) in R15.

    The same process until R56...

    I am very new at vba but here is what I tried to do:

    'Step 1 I say to my program to brows all the lines (GRC is my range from R13 to R56)[/COLOR]
    For J = 1 To GCR.Count

    'Step 2 for each row I do a count that I call nbcells
    nbcells = Application.WorksheetFunction.Count(GCR.Range("J, 1"))

    'Step 3 I copy past the result in the line[/COLOR]
    GCR.Cells(J, 1).Copy
    GCR.Cells(J, 1).PasteSpecial xlPasteValues
    Next J

    I think I have a problem to select my column in step 2.

    Well if somebody has some hint (the simpler the better) it will be greatly appriciated.

    Thanks for reading and have a great day.
    Last edited by historic777; 03-30-2013 at 06:43 AM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: for every line I browse make a count and post this count in a cell (fiouuu)

    Hi, historic777,

    maybe try this code:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    03-29-2013
    Location
    milan
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: for every line I browse make a count and post this count in a cell (fiouuu)

    Wouuuuuaaah amazing!!! Thank you for this fast and precise answer Holger!

    It works perfectly!

    Have a great day,

    Fred

+ 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