Posts by holycow

    Here is a shorter version of your macro


    Modified your code as follows:-


    It is very good advice that your macro must not contain .Select


    For example recorder code will have a line ending in .Select and the next line beginning Selection.


    You should always merge those 2 lines


    Code
    Sub test1() 'EXAMPLE OF RECORDER CODE THAT CAN BE MERGED TO ONE LINE
    Range("A1").Select
    Selection.Value = 1
    End Sub
    
    Sub test2() 'MERGE TO ONE LINE LIKE THIS
    Range("A1").Value = 1
    End Sub

    I hope you will enjoy VBA.