

Outarr = Range(Cells(1, 1), Cells(lastrow + 7, 6)) ' ActiveWorkbook.SaveAs "C:\tmp\" & teachername & ".xls" Range(Cells(1, 1), Cells(lastrow + 7, 6)) = outarr Outarr(1, 1) = "Target Review " & inarr(i, 2) & " " & teachername I have some spreadsheet of dummy data you can work with if you want to take a closer lookĢ.Ğxample of the data I want to export for one teacher (called Target Review Year 10 Teacher#20)ģ.Ğxample of a reconstructed table (called 3 Recompiled) Provide a separate Save button for the user such that when pressed the records which are part of the table are copied over the records which already exist in the master. O Save with a file name that identifies the teacher and year group O Give the records (not the headings) a range name identify the teacher OĚdd some formula columns to the right of the table (but with the same number of rows) Do this by selecting the Personal.xlsb workbook, then Insert Module. We need to start off the macro by inserting a New Module.
#HOW TO WRITE A MACRO IN EXCEL TO EXTRACT DATA HOW TO#
Today let’s take a look at how to remove duplicates from a single column of data. OĜopy into a new sheet, a few rows down to allow for some summary formulas and heading to be added Macro Mondays Create A Shortcut To Your Personal Excel Macro Workbook. Oğilter the table to display that teachers student/ subject/ class

Ĝopy / paste the teacher name column on the table and remove duplicates so that you have a list of all the teachers. I need a save option that will enable that teachers spreadsheet to paste into a master sheets basically re-compiling the master with all the teacher changes. I need to be able to export a spreadsheet for each teacher that will enable them to change targets (in a separate column). Each row includes the subject/class name/teacher name and the student’s target in that subject. There are about 250 students in a year group who generally take ten subjects so there are 2500 rows in a table for each year group.

In this article we will be looking at how to export Access data using VBA code. Here is an interesting 'real-world' school based problem. It is possible to link an Excel hyperlink to a VBA macro with an event.
