Move Data from one work sheet to another VBA

nr6281

New Member
Joined
Jun 19, 2019
Messages
37
Hi All,

Previously I had a little help online including in this forum on finding how to write a macro to move data from one workbook to another,

This time its the same idea but from one worksheet to another 2 worksheet based on a True or false.

From Raw Data file: I want to move all with True in Column AN to worksheet Reported1 and True from column AO to worksheet Disabled!


 
Hi,

The issue is once I run the macro it takes time so if you could help tweak this as paste values in the reported sheet and disabled sheet

That's exactly what the macro of post #5 does.


I made some changes to improve performance, but if it still takes some time it is due to the amount of data you have on the sheet.

Try this.
Code:
Sub Move_Data()
  Dim sh As Worksheet
  Application.ScreenUpdating = False
  Application.Calculation = xlCalculationManual
  Set sh = ActiveSheet
  If sh.AutoFilterMode Then sh.AutoFilterMode = False
  sh.Range("A1:AO1").AutoFilter Field:=40, Criteria1:=True
  sh.AutoFilter.Range.EntireRow.Copy
  Sheets("Reported1").Range("A1").PasteSpecial xlValues
  sh.AutoFilter.Range.Offset(1).EntireRow.Delete
  sh.ShowAllData
  sh.Range("A1:AO1").AutoFilter Field:=41, Criteria1:=True
  sh.AutoFilter.Range.EntireRow.Copy
  Sheets("Disabled").Range("A1").PasteSpecial xlValues
  sh.AutoFilter.Range.Offset(1).EntireRow.Delete
  sh.ShowAllData
  Application.ScreenUpdating = True
  Application.Calculation = xlCalculationAutomatic
End Sub
 
Upvote 0

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,223,956
Messages
6,175,616
Members
452,661
Latest member
Nonhle

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