thanks - your tip for the first problem appears to have fixed the problem all through this part of the sub, just having problems with:

' hide unused columns
    i = 32 + M
    j = 49 + M
    k = 66 + M
    
    Range(R8Ci, R8C44).Select
    Selection.EntireColumn.Hidden = True
    Range(R8Cj, R8C63).Select
    Selection.EntireColumn.Hidden = True
    Range(R8Ck, R8C80).Select
    Selection.EntireColumn.Hidden = True