VBA code for copy of information based on a date criteria

Andries

Board Regular
Joined
Feb 3, 2011
Messages
127
Hi

I need some help with VBA. I am new to this so I am trying. I have a sheet with 10 columns and 3000 rows. The first column contains dates.
What the code should do is to look at what date is entered in the textbox or inputbox on sheet1 and it should then extract(copy) the information (from sheet2) that is only relevant to that specific date and paste it into sheet1.

Thank you in advance
Dries
South Africa
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Hi

Thanks it is working perfectly. Next question...what is the code for hiding and unhiding a sheet?
 
Upvote 0
Select from these

Code:
ActiveSheet.Visible = xlSheetVisible
ActiveSheet.Visible = xlSheetHidden
ActiveSheet.Visible = xlSheetVeryHidden
 
Upvote 0
My ActiveSheet is called "data2"...how do I re-write the code to unhide and hide again. Obviously the macro does not work if the sheet is hidden

Sheets("Request Form").Select
Sheets("Request Form").Range("A11:J10000").Select
Selection.copy
Sheets("data2").Select
Range("e2").Select
ActiveSheet.Paste
 
Upvote 0
Try this

Code:
Sheets("Request Form").Range("A11:J10000").Copy Destination:=Sheets("data2").Range("E2")
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,876
Members
452,949
Latest member
Dupuhini

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