Copy and Paste specific columns with VBA

DianaMomOf5

New Member
Joined
Mar 12, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I am pretty new to VBA and stuck. I am trying to create a roster of people looking at a sheet with all people in it for a year. I want to be able to build a macro that will pull certain columns from the large dataset for every row that meets a data criteria. I want to be able to have the macro reference a cell for the date criteria so that a user can change the date and then run the macro to pull the roster data for the date entered into a reference cell. Is that possible? All the videos I see only hardcode in a criteria for cut/paste...
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,588
Office Version
  1. 2013
Platform
  1. Windows
Ok. So user enters "Cat" in range("A1") of sheet named "Alpha"
Now lets search column B of sheet named "Bravo" for the value "Cat"

And what do we do with the rows that have "Cat" in column "B"

Please provide specific details like this:
 

DianaMomOf5

New Member
Joined
Mar 12, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Ok. So user enters "Cat" in range("A1") of sheet named "Alpha"
Now lets search column B of sheet named "Bravo" for the value "Cat"

And what do we do with the rows that have "Cat" in column "B"

Please provide specific details like this:
Thank you for replying! OK, so, as an example, I have the following:

Date of Class need roster for: B2

Sheet 1 Data houses records for all registered students for a fiscal year and the data elements are as follows:

Status. First Name. Last Name. Phone Number. Class Date. Followup Needed Book Level Assigned. Notes
A4. B4 C4 D4 E4. F4 G4 H4

I want to be able copy First Name, Last Name, Phone Number and Book Level Assigned from Sheet 1 into a new Sheet 2 IF the Class Date in Column E matches the Roster Date B2

Is that possible?
 

Watch MrExcel Video

Forum statistics

Threads
1,130,083
Messages
5,639,977
Members
417,120
Latest member
Pavithra devi

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
Top