Hi Mohan,
Try this
and call the routine like..Code:Sub InsertRows(ByVal RowNo As Long, ByVal NoOfRows As Long, Optional ByVal Sht As Worksheet) Dim lngSU As Long Dim lngCalc As Long With Application lngSU = .ScreenUpdating .ScreenUpdating = False .EnableEvents = False lngCalc = .Calculation .Calculation = xlCalculationManual End With If Sht Is Nothing Then Set Sht = ActiveSheet Sht.Rows(RowNo).Resize(NoOfRows).Insert With Application .ScreenUpdating = lngSU .EnableEvents = True .Calculation = lngCalc End With End Sub
Code:Sub Test() InsertRows 10, 5 End Sub




Reply With Quote
Bookmarks