Results 1 to 5 of 5
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dubt on column count... (2000 sr 1)

    This piece of code count 256 column but in H have only one...


    II = Sheets(FOGLIO).Cells(I, "H").End(xlToRight).Column

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Dubt on column count... (2000 sr 1)

    If all columns to the right of H are empty, End(xlToRight) will indicate the 256th and last column in the Worksheet.

    Try

    II = Sheets(FOGLIO).Cells(I, "IV").End(xlToLeft).Column

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dubt on column count... (2000 sr 1)

    to understand....
    You use Left inested Right because you make "Algebric summ" 256-left column A
    ????
    Right?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Dubt on column count... (2000 sr 1)

    Cells(I, "IV") is the rightmost cell in the row, since column IV is the last column in an Excel 2000 worksheet.
    Cells(I, "IV").End(xlToLeft) refers to the first non-empty cell you encounter when going from Cells(I, "IV") to the left. In other words, it is the last non-empty cell in the row.

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dubt on column count... (2000 sr 1)

    ..haaaaaa
    Tks for explain.

Posting Permissions

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