filter and copy rows into another sheet

revozero

New Member
Joined
Feb 10, 2016
Messages
7
Hi there

first time poster, very new to VBA

What im looking to do it writing a VBA procedure (not a function) to do an extraction job, where you first would set the Y/N field for each record manually, once the set is complete with Y/N's i want to then be able to press an active X button of some sort which then moves the records which are marked with a Y into another sheet, but i need to be able to factor in events where some records might be changed to N and then need to be moved back, is this possible? if so how would i write this code?

Thanks :)
 
Yeah, the only code i have in the workbook at the moment are codes to lock the scroll area of the first page and default open to the sheet aswell
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
In post #3 you said it was putting the values in sheets 3 and 4
So that means you know how to install the script and it was working just to the wrong sheet.
So what is wrong with the second script I sent you.

In post #7 you said it did not work but did not explain what it did do.

And the value Y must be a capital Y like in your original post
 
Last edited:
Upvote 0
Sorry, in post 3 I meant that I your code you put together for me didn't do anything, and that the relevant sheets are 3 & 4 (as I realised I didn't provide this information), I did get a code working (which I copy and pasted into post 3, i found this elsewhere and edited it abit) but its a very rough code and doesn't entirely do what I need, it copies stuff over to sheet 4 but deletes entries from the originating table in sheet 3
 
Upvote 0
I need you to follow these instructions and use this script and tell me if it works.

This is a modular script which gets put in a module.
1.Right click on any sheet tab.
2. Choose View Code
3. On the menu choose "Insert"
4. Choose Module
5. Paste in the code
6. Then to run the macro
7. Close that window
8. On the ribbon choose "view"
9. Choose macro and choose the macro named "Sub If_Equals_Y"
10. If you want you can make a button to run the script or a keyboard shortcut.
This script will say "Hello" and that's all.
Code:
Sub Hello()
MsgBox "Hello. This Works"
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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