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!


 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Try this

Code:
Sub Move_Data()
  Dim sh As Worksheet
  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")
  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")
  sh.AutoFilter.Range.Offset(1).EntireRow.Delete
  sh.ShowAllData
End Sub
 
Upvote 0
Hi Dante,

Thank you this works perfect however, I think due to the formula I have in Column AN and AO it takes a lot of time so can I have them paste as Values in the Reported1 sheet and Disabled?
 
Upvote 0
Cross posted https://www.excelforum.com/excel-pr...-data-from-one-work-sheet-to-another-vba.html

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0
Hi Dante,

Thank you this works perfect however, I think due to the formula I have in Column AN and AO it takes a lot of time so can I have them paste as Values in the Reported1 sheet and Disabled?

Try this

Code:
Sub Move_Data()
  Dim sh As Worksheet
  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
End Sub

Please, don't forget to put the links of the other threads here.
 
Upvote 0
Please, don't forget to put the links of the other threads here.
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,223,954
Messages
6,175,603
Members
452,658
Latest member
GStorm

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