Create new worksheet & copy the based on date [Solved/Closed]

Raja - Apr 8, 2012 at 08:36 AM - Latest reply:  Raja
- Apr 9, 2012 at 06:25 AM
Hello,
Can any one help me to copy the excel sheet data from one sheet to another sheet?

-> I have one excel sheet (name: Test.xls, sheet name: SHEET1)

Sn Code Type next calib
5 BPR CORR 7-Apr-12
4 BPR CORR 7-Apr-12
73 BPR CORR 7-Apr-12
9 BRG CORR 8-Apr-12
10 BRG CORR 8-Apr-12
11 BRG CORR 8-Apr-12
17 BRG CORR 9-Apr-12
311 DP CORR 9-Apr-12
227 DP CORR 9-Apr-12
227 DP CORI R 9-Apr-12

Want to create a new work sheet and copy the today's date(next calib - filed name) records to new sheet.

Example: Today's Date is 8-Apr-12
So, I want to copy following record to new work sheet (when I click the button / run the macro).

Sn Code Type next calib
9 BRG CORR 8-Apr-12
10 BRG CORR 8-Apr-12
11 BRG CORR 8-Apr-12

Please help to write the code.
Thanks!

See more 

17 replies

Best answer
rizvisa1 4481 Posts Thursday January 28, 2010Registration dateContributorStatus January 6, 2016 Last seen - Apr 8, 2012 at 08:38 AM
3
Thank you
Start macro recorder
Apply the filter for date
copy the visible rows
paste
stop the recorder

this will give you a good template to work from

Thank you, rizvisa1 3

Something to say? Add comment

CCM has helped 1795 users this month

rizvisa1 4481 Posts Thursday January 28, 2010Registration dateContributorStatus January 6, 2016 Last seen - Apr 8, 2012 at 03:56 PM
One thing you need to correct is "K" and 12 part

both refers to the column on which you want to apply filter. Since you said , next calibration date, "K" should have been "L"
Thanks a lot!

Now code is working as expected

Thanks again!
Hi, I want to Learn more regrading the macros... Can you please share some links for learn excel macros
rizvisa1 4481 Posts Thursday January 28, 2010Registration dateContributorStatus January 6, 2016 Last seen - Apr 9, 2012 at 05:25 AM
There should be some sites for that.
I find excel macro recorder is the best. It gives you a good template to start from, Plus if you study and try to understand that code, you learn too.

http://office.microsoft.com/en-gb/training/overview-RZ001150634.aspx?section=1
http://www.excel-vba-easy.com/
Thanks a lot :-)