![]() ![]() 'You can delete the copied rows in the source sheet using below statementĮlseIf Sheets("YourMain").Range("A" & j) = "Follow up" ThenĬRow = Sheets("Follow up").Range("A50000").End(xlUp).Row Sheets("YourMain").Rows(j).Copy Destination:=Sheets("Pending").Range("A" & cRow + 1) ![]() If Sheets("YourMain").Range("A" & j) = "Pending" ThenĬRow = Sheets("Pending").Range("A50000").End(xlUp).Row 'looping throu your main sheet and copying the data into respective sheet 'Assuming you have the drop-down in the first Column (= Column A) 'Let's find these items in the Main sheet and send to the respective sheet LRow = Sheets("YourMain").Range("A50000").End(xlUp).Row 'Last row in your main sheet 'See the below example to copy the rows based on criteria 'You can also copy entire row and paste into different sheets based on certain criteria. The following VBA Code to helps you to Copy and Paste the Data based on certain condition. Most of the times we need VBA code to copy data from one sheet to another based on criteria. Sheets("SourceSheet").Range("B4:B5").Copy Destination:=Sheets("TargetSheet").Range("C2")Ĭopy Data into Another Sheet based on Criteria 'Sheets(Your Source Sheet).Rows(Your Source Range).Copy Destination:=Sheets(Your Target Sheet).Range(Your Target Range) 'You can use the below statement to Copy and Paste the Data Sub VBAMacroToCopyDataFromOneSheetToAnother() Here is the simple VBA Code to Copy and Paste the Data from one worksheet to another. Download the Example Macro Workbook:ĭownload the Example VBA Macro File and Explore the code example to copy the data from one sheet to another worksheet:Ĭopy Data Form One Sheet To Another Sheet Copy from One Sheet And Paste in Another Worksheet The main difference between two methods is, we should know the destination worksheet name in the first method, in second method we can just activate any sheet and paste it. Method 2: In this method, we have to activate the worksheet and paste in a range of active worksheet. This is the simple method to copy the data. We have to mention the source and target range. Method 1: In this method, we do not required to activate worksheet. Now you should see the required data (from sheet1) is copied to the target sheet (sheet2).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |