hi p45cal
sorry to bother u again ,i was trying to change this line of code
            If Var < 6 Then
                
                For iw = mylookin.Rows.count To 1 Step -1
                    'mylookin.Cells(iw).Select
                    If Var < 6 And mylookin.Cells(iw).Value <> "Weekly" Then    '''to make 6 count weekly
to this
            If Var < 6 Then
                'If Var  Then
                For iw = mylookin.Rows.count To 1 Step -1
                    'mylookin.Cells(iw).Select
                    If Var < 5 And mylookin.Cells(iw).Value <> "Weekly" Then    '''to make 6 count weekly
but then code did not change the data sheet as needed when i run the macro again can u let me know what mi doing wrong
by the way my intention is to change the limit from 6 to 5 or 4 since there r some time data change so i need to change that value but it must be less then 6 how can i do that?
yr help is appreciated.