You are here:

Excel/Excel Coding - Creating a macro?


I am trying to copy dates filled out (in the cells) in one sheet to a master sheet. I know I can use the ='Sheet name'!A5 function, but there are over 30 sheets and many dates that I would like auto-filled to the first sheet. Is there a way to write a code that I can drag to all of the cells that will essentially say that Sheet 1, Row 1, Column 1 = Sheet 2, Row 1, Column 1...Sheet 1, Row 2, Column 2 = Sheet 3, Row 1, Column 1...Sheet 1, Row 3, Column 3 = Sheet 4, Row 1, Column 1...etc.

Thank you for your help.

Hello Annette,

If you have a uniform sheet naming convention, you could create an index of all the sheet names and then link the formula from there.
Eg. Before the Column A of your master sheet, insert a column and add the sheet names of the sheets from where you are going to pick up the date. Then, using Indirect function, build a formula that picks up the sheet name from first column, and then enter rest of the formula.

If my suggestion is not clear, please send me the screenshots of your master screen and atleast 2-3 other sheets and I'll send across the formula.

Hope this answers your question.

About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts




I can answer questions related to the following topics: 1. MS Excel - Creating and Linking Formulae, Running Pivot Tables, Vlookup etc. 2. Macros / VBA - Creating Macros to do specific jobs. Importing / Exporting / Validating Data in excel through Macros.


I've been working on excel for over 10 years and on VBA macros for over 3 years now.

Bachelor of Commerce, Chartered Accountant from The Institute of Chartered Accountants of India

©2017 All rights reserved.

[an error occurred while processing this directive]