What to use instead of .EntireColumn

  • I'm trying to create a simple counting sheet which has 5 buttons to increment the count of each field,

    a 'New Round' Button to start a new round in a new column (R2 and so forth)

    and Clear button which clears all the counts and start over again from Round1



    The code works fine, but it clears the entire columns so that means the totals and grand total also gets cleared. How do I prevent this from happening by not specifying .EntireColumn attribute and instead a specific range?




  • Hello,


    Below are two instructions to get last row and last column - Dim As Long

    Code
    ' Last Column
     lastcol = ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column
    ' Last Row
     lastrow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row


    Hope this will help

    :)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • Hello,


    In order to allow for testing ... much better than a picture ... why don't you attach a sample file :)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • Thanks for your Like :thumbup:


    Have you managed to fix your problem ... ? ;)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • Hi Carim


    I will get back to you tomorrow morning (my time) with the updated spreadsheet


    No problem ... it should not take too long to fix ...;)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • Glad you could fix your problem ...:):):)


    Thanks a lot for your Thanks ...AND for the Like :thumbup:

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!