Copy data from certain cells to other sheets

markmac99

New Member
Joined
May 25, 2008
Messages
18
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I have attached a screenshot of a workbook that I'm working on that needs to copy a number of cells to other sheets (Courses 1 to 4) if an 'x' appears on the booking form sheet in columns E to H. My current setup is to use =IF('Booking Form'!E2="x",'Booking Form'!A2,0) in Course 1 tab and F2, G2, H2 for each sheet thereafter, copying the formulas down each sheet. This works apart from the fact that the Course 1 to 4 tabs have gaps when there's no data to copy across (see image). Is there a simple way to adapt the IF formula or should I use code to copy the data from columns A to C across to the Course tabs?

Regards

Mark
 

Attachments

  • Booking Form.png
    Booking Form.png
    18.8 KB · Views: 7
  • Course 1.png
    Course 1.png
    16.9 KB · Views: 7

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
What version of Excel are you using?
Please update your account details to show this, as it affects which functions you can use.
 
Upvote 0
Thanks for that, how about in A2 copied down & across
Excel Formula:
=IFERROR(INDEX('Booking form'!A$2:A$12,AGGREGATE(15,6,(ROW('Booking form'!$A$2:$A$12)-ROW('Booking form'!$A$2)+1)/('Booking form'!$E$1:$H$1="Course 1")/('Booking form'!$E$2:$H$12="X"),ROWS(A$2:A2))),"")
 
Upvote 0
OMG, that works perfectly. I've just copied across all four sheets - changing the sheet name of course - and it's exactly what I was after.

Thank you very much Fluff :)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
You're welcome & thanks for the feedback.
Fluff,

I am just about there with my spreadsheet but I've noticed that on occasion some staff members have to appear on two or more course sheets and not just the one. How could I tweak your formula to add additional criteria to look for an X in Course columns 1, 2, 3 and 4?

=IFERROR(INDEX('Booking form'!A$2:A$12,AGGREGATE(15,6,(ROW('Booking form'!$A$2:$A$12)-ROW('Booking form'!$A$2)+1)/('Booking form'!$E$1:$H$1="Course 1")/('Booking form'!$E$2:$H$12="X"),ROWS(A$2:A2))),"")

Kind regards,

Mark
 
Upvote 0
Did you change the "Course 1" to "Course 2" etc for each sheet?
If so, with the image in your op, Mrs Monkey should appear on both the Course 2 & Course 3 sheets.
 
Upvote 0
Did you change the "Course 1" to "Course 2" etc for each sheet?
If so, with the image in your op, Mrs Monkey should appear on both the Course 2 & Course 3 sheets.
Yes I did and I can see why this isn't making sense. My OP was a very simple table with four courses and your formula is spot on. The actual sheet that I'm working on is a little more complex, in that if a staff member has an X in one column - let's say course 1 - his details are then copied to other sheets that all form part of course 1. Course 1 could be maths, English and French, so that person's details would be booked onto all three sheets. All I need is a way to include other sheets in the formula and not just looking at one sheet. Is this a fairly tweak or would I need to start over?

Regards,

Mark
 
Upvote 0
You would be better off having a master sheet that includes all the data, which can then be pulled over to the other sheets.
Trying to check multiple sheets for data would not be simple & the formulae required to do that could well bog the workbook down.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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