Copy from base roster to personal roster (VBA)

Phil Smith

Active Member
Joined
Aug 13, 2004
Messages
281
Hi Excel people.

I have a worksheet, "Base Roster", which contains my work base roster in numerical order from Week 1 in row 2 down to Week 80 in row 81.

I have a regular swap with a colleague, so have another worksheet ("My Roster") where one week I work my own line of work, the next week I work my colleagues line of work and vice versa. He works all the early shifts and i work all the lates.

At the moment my code loops through the base roster so C3:AD3 is then named as "Week1", through to C81:AD81 named as "Week80". The code then loops through each line of "My Roster", extracts the week numbers B2:B81 then copies and pastes the apporpriate range "Week1" etc, to each line.

What I would like to happen is that when each line of the base roster is filled and named, that week number is then searched for in "My Roster", which could appear more than once, and then the relevant week pasted to that relevant row.

Thanks in advance.
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,618
Office Version
  1. 2007
Platform
  1. Windows
What I would like to happen is that when each line of the base roster is filled and named
You could put generic examples of what you have on each sheet before it is filled and named.
And then the result you want after filling and naming.
 

Watch MrExcel Video

Forum statistics

Threads
1,126,986
Messages
5,621,993
Members
415,873
Latest member
fuulhouse

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