Hope Someone Can Help

razorblade

New Member
Joined
Oct 9, 2006
Messages
6
I have a Workbook with several sheets all of which are the same layout and 1 final sheet (Sheet6) which will give a list of all arrivals and departures.

I have dates along the top with Personel down the left side.

I need a macro or something that can look through sheets 1-5 on a specified column (date).

If there is an 'A'(Arrival) i need it to copy Column 'A', 'B', 'C' & 'D' into the same columns on Sheet 6. If it is an 'X'(Departure) i need it to insert Columns 'A', 'B', 'C' & 'D' into 'F', 'G', 'H' & 'I' on sheet 6.


Hope someone can help. I can send a dummy copy of the workbook to anyone if they want to have a play around and understand better.

Sorry for the lame description :oops:


Many thanks in advance

David
 
Hello,

From the relevant spreadsheet, select TOOLS --> MACRO --> VISUAL BASIC EDITOR, a new window will appear.

Select VIEW --> PROJECT EXPLORER (this many already be open), in here you should see VBAProject (your spreadsheet name). If this has a + to the left, press it with the mouse and it should change to a - (if it isn't already).

You should now see

Microsoft Excel Objects
and all the sheet names.

select INSERT --> MODULE

Modules
Module1 will now be added and the large window will show (General) and (Declarations) paste the code in here.

GO back to the spreadsheet select TOOLS --> MACRO --> MACROS
change MACROS IN All OPen WOrkbooks to THIS WORKBOOK and select arrivals_departures.
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,216,064
Messages
6,128,562
Members
449,458
Latest member
gillmit

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