Copy data after last used row in other sheet

narsing18

New Member
Joined
Jan 30, 2017
Messages
39
Code:
Sub INFY_BANK()
Dim lastRow As Long
' INFY_BANK Macro


     With Excel.Application
        .ScreenUpdating = False
      End With
    Range("N1").Select
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "SLA HRS LEFT"
    Range("N2").Select
    ActiveCell.FormulaR1C1 = "=RC[-2]-RC[-1]"
    Range("N2").Select
    Selection.AutoFill Destination:=Range("N2:N10000")
    Range("N2:N10000").Select
    Rows("1:1").Select
    Selection.AutoFilter
    ActiveSheet.Range("$A$1:$AC$10000").AutoFilter Field:=14, Criteria1:=">=0", _
        Operator:=xlAnd, Criteria2:="<=48"
    ActiveSheet.Range("$A$1:$AC$10000").AutoFilter Field:=10, Criteria1:=Array( _
        "WIP", "With Assignee", "With CCB Approver", " With CCB Approver After Patch Initiation", "With Reviewer For Clarification", " Initiation", "With Release Manager Team For RCD Approval", "With Reviewer For Patch", "With Reviewer For Closure"), Operator:=xlFilterValues
    Range("A1").Select
    Range(Selection, Selection.End(xlDown)).Select
    Range(Selection, Selection.End(xlToRight)).Select
    Selection.Copy
    Sheets("Calls Breaching in 48hrs").Select
    Range("A1").Select
    ActiveSheet.Paste
    Sheets("Sheet1").Select
    ActiveWindow.ScrollRow = 1
    ActiveSheet.Range("$A$1:$AC$10000").AutoFilter Field:=10, Criteria1:= _
    "With Requestor For Clarification"
      ActiveWindow.ScrollColumn = 1
      'Trying to make copy data after the last used row
      
lastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row + 4
Range("B" & lastRow).Select
Selection.PasteSpecial
   ' Range("A1").Select
   ' Range(Selection, Selection.End(xlDown)).Select
   ' Range(Selection, Selection.End(xlToRight)).Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Calls Breaching in 48hrs").Select
       ActiveWindow.ScrollRow = 113
    Range("A250").Select
    ActiveSheet.Paste
    Sheets("Sheet1").Select
    ActiveWindow.ScrollRow = 1
    ActiveSheet.Range("$A$1:$AC$10000").AutoFilter Field:=14, Criteria1:=">=0", _
        Operator:=xlAnd, Criteria2:="<=120"
    ActiveSheet.Range("$A$1:$AC$10000").AutoFilter Field:=10, Criteria1:=Array( _
        "WIP", "With Assignee", "With CCB Approver", " With CCB Approver After Patch Initiation", "With Reviewer For Clarification", " Initiation", "With Release Manager Team For RCD Approval", "With Reviewer For Patch", "With Reviewer For Closure"), Operator:=xlFilterValues
    ActiveWindow.ScrollColumn = 1
    Range("A1").Select
    Range(Selection, Selection.End(xlDown)).Select
    Range(Selection, Selection.End(xlToRight)).Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Calls Breaching in 5 days").Select
    Range("A1").Select
    ActiveSheet.Paste
    Sheets("Sheet1").Select
    ActiveWindow.ScrollRow = 1
    ActiveSheet.Range("$A$1:$AC$10000").AutoFilter Field:=11, Criteria1:= _
        "With Requestor For Clarification"
     'Trying to make copy data after the last used row
     ActiveWindow.ScrollColumn = 1
    Range("A1").Select
    Range(Selection, Selection.End(xlDown)).Select
    Range(Selection, Selection.End(xlToRight)).Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Calls Breaching in 5 days").Select
    ActiveWindow.SmallScroll Down:=129
    Range("A250").Select
    ActiveSheet.Paste
    With Excel.Application
        .ScreenUpdating = True
       End With
End Sub


in the above code i am trying to insert small code which can identify last used row and copy the data after that. it should leave 4 lines blank before copy the data
i tried something like
Code:
lastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row + 4
Range("A" & lastRow).Select
Selection.PasteSpecial
but it never worked for me.

please help
 
Last edited:

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Re: want to copy data after last used row in other sheet

Try this line for the four row spacing...

Howard

Code:
Sub Four_Blank()

  Range("A" & Rows.Count).End(xlUp)(6) = "Stuff"

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,849
Messages
6,121,922
Members
449,056
Latest member
denissimo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top