Forum

Macro to copy range
 
Notifications
Clear all

Macro to copy range

9 Posts
2 Users
0 Reactions
57 Views
(@mymalone)
Posts: 103
Estimable Member
Topic starter
 

Can someone help?  I would like to copy a range from one worksheet to another worksheet, but I would like to copy based on the criteria.  For example, I would like for it to copy the 2nd week of each month.  Do I have to enter a line of code for each month or is there another way to get the info.  Is there a condition to for example to ask for the 2nd, week of the month.  I will create another sheet with a different macro to capture the 3rd week of the month.

Thanks

 
Posted : 11/07/2018 5:22 pm
(@sunnykow)
Posts: 1417
Noble Member
 

Hi Melinda

Give this a try.

I have added a helper row to identify the week number (hope it is correct)

Select the required month and then click the copy button

Hope this helps.

Sunny

 
Posted : 14/07/2018 12:14 am
(@mymalone)
Posts: 103
Estimable Member
Topic starter
 

Sunny

You are the BEST!!!  This is way more than I imagined.  I love how you simplify excel, which makes it so exciting.

Thank you so very much...

 
Posted : 14/07/2018 9:28 am
(@sunnykow)
Posts: 1417
Noble Member
 

Hi Melinda

Thanks for your feedback.

Cheers

Sunny

 
Posted : 14/07/2018 7:24 pm
(@mymalone)
Posts: 103
Estimable Member
Topic starter
 

Sunny

how would I add the actual date for each.  For example the first Monday of each week?

 

Thanks

 
Posted : 03/08/2018 3:02 pm
(@sunnykow)
Posts: 1417
Noble Member
 

Just enter a date into cell D2 which correspond to the 1st Monday of January. In my earlier attached file, 1/1/2018 happens to be a Monday.

All the other dates will auto change to Monday. You can test this by entering =TEXT(D2,"ddd") in cell D3 and copy across the row.

All these cells will show Mon (Monday).

Hope this helps.

Sunny

 
Posted : 03/08/2018 8:54 pm
(@mymalone)
Posts: 103
Estimable Member
Topic starter
 

Sunny

Let me see if I can do a better job of explaining.  On Sheet1 the dates are listed on Row 2 beginning with D2.  I would like the dates to show on Sheet2 on Row 3.  For example, when the "Select Week Number" is "1", the dates should show 1/1/2018, 2/5/2018, 3/5/2018, and etc.  When the "Select Week Number" is "2", the dates  are 1/8/2018, 2/12/2018, 3/12/2018, and etc.  I hope this helps.

 
Posted : 04/08/2018 8:52 am
(@sunnykow)
Posts: 1417
Noble Member
 

OK see if this is what you wanted.

 
Posted : 04/08/2018 12:25 pm
(@mymalone)
Posts: 103
Estimable Member
Topic starter
 

Sunny

You are so good!!  Perfect.

Thank you so very much....

 
Posted : 04/08/2018 12:44 pm
Share: