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

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
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:
 
Upvote 0
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?
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

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