Macro - 10 Workbooks Into 1 Workbook With 10 Sheets
Jan 24, 2014
I'd like to create a macro that will take 10 workbooks and add them to a new work book, but have each workbook as a separate sheet.
So every month from work I get a report file labeled as the current month (JAN_14). Then there about 19 folders in that folders labeled with product names; then in those folders are two excel files (they're all named MSTASCH_QUICKLOOK_1 and MSTASCH_QUICKLOOK). I figure if I can see the macro to combine 10 workbooks I can change it to do less or more workbooks. I had tried a macro that takes the workbooks from one file and puts them into two seperate sheets (although I would love to have the order changed of how they're put into the workbook).
VB:
Sub MergeSheets()
Dim wbDst As Workbook
Dim wbSrc As Workbook
[Code]....
View 4 Replies
ADVERTISEMENT
Apr 9, 2014
I am trying to combine several workbooks containing data in multiple sheets into a master workbook. All the workbooks have the same number of worksheets. I would like to combine all data in Sheet1 into a new Sheet1, all data from Sheet2 into a new Sheet2, etc.
View 1 Replies
View Related
Feb 8, 2007
I have 100's of workbooks that have a mispelled word in a cell. Some of the workbooks have more than one sheet. I have written a macro that will correct the mispelling, and now would like to have the macro run automatically everytime I open a workbook, I would like for it to check all the sheets, but if not, then whatever sheet the workbook opens to will be fine. Here is the macro.
Sub mySpelling()
Dim myWord
Range("b22").Select
myWord = ActiveCell
If myWord = "Quanity" Then
ActiveCell.FormulaR1C1 = "Quantity"
End If
End Sub
I have done a search and have seen about "personal.xls", that does not seem to work. Thinking that I will have to add something to XLStart folder but not sure.
View 3 Replies
View Related
Jul 7, 2009
I have a large workbook with many worksheets which are all grouped into pairs - i.e. Sheet1 & Sheet2 go together, Sheet3 & Sheet4 go together; Sheet5 & Sheet6 go together, etc. etc.
I need a macro to divide this workbook into separate workbooks where each group of worksheets has a separate file of its own and I want to name the new workbooks after the second sheet in each group:
i.e. A new workbook for Sheet1 & Sheet2 called Sheet2.xls; a new workbook for Sheet3 & Sheet4 called Sheet4.xls; a new workbook for Sheet5 & Sheet6 called Sheet6.xls; etc. etc. etc.
View 12 Replies
View Related
Jan 10, 2014
I am trying to implement the idea of creating an application with two workbooks: a hidden code workbook (CodeWb) that holds all of the forms and macros, and a separate visible data workbook (DataWb) that uses the macros in CodeWb. The DataWb houses a little bit of VBA code to open the CodeWb, which then supplies the programming power to handle click events, etc., performed by the user in the DataWb.
I have advanced to the point of being able to open CodeWb from DataWb and trigger execution of a macro named "DataFileOpen" in CodeWb. This macro initializes things in DataWb and creates buttons there on a particular sheet, using the line:
Application.Run "CodeWb.xlsm!DataFileOpen"
So far so good. This works fine. My problem is that nothing happens when I click on the buttons created in DataWb, with their event handling code residing in CodeWb. Obviously, I'm missing something that maintains a connection between the two workbooks.
How can I use the code in CodeWb to handle all events occurring in DataWb?
View 2 Replies
View Related
Apr 19, 2006
I have several individual excel workbooks all in one folder that I need to do some analysis on, but in order to that i need to have them all in one workbook. all of the files are saved in the same folder on my shared drive. each record from each of the files needs to be transfered over into this blank template that i have. I used the Blank template to create all of the individual files, Now i just need to get them all into one file that is easier to work with
View 9 Replies
View Related
Mar 31, 2009
I have a spreadsheet which has all the names of trips from a warehouse, the day that they operate (1,2,3 etc) and the job line allocated to each trip. It looks something like that:
A B C
DAYTRIPCUST
I would like to create a macro that will be creating 7 new workbooks and then in those workbooks as many sheets as the trips. In these sheets, the customers should be displayed.
How do I write it? I could not find how to have a "dynamic choice" in the macro. I.e. not to have the criteria as "1", "trips1" but to choose from the range of inputs that are available.
View 9 Replies
View Related
Mar 16, 2008
I have about 20 workbooks with different file names for different projects all saved in the same folder. Each workbook has about 10 worksheets and each worksheet is named in a similar fashion in each of the 20 workbooks (eg. revenue, cost, variance etc.). I want to pull out a worksheet named ' forecast' from each workbook into a master workbook so that the master workbook would contain the 20 forecast worksheets.
View 9 Replies
View Related
Jun 7, 2014
I have 3 workbooks open. 1 is my working file and I name it as "Final[date].xlsm". The other 2 files are my source files which are also open are named as source1.xlsx and source2.xlsx. Both the source files has only one tab/sheet as "Sheet1". My objective is to bring the contents of the source file to my working file in 2 different sheets. all the contents in Sheet1 of "Source1.xlsx" should be paste.values only to the "Final[date].xlsm" with a sheet name "BankDetails". This will enable the user also to replace the old data in "BankDetails" tab. The "source2.xlsx" sheet1 has a different situation. I need to copy only the cells with values, not the entire cells, because it has to be pasted (values only) to range C2:L. I have formulas in the other columns before C and after L.
Take note that my working file name is changing every based on the date while my source file has always same file name.
View 12 Replies
View Related
Nov 6, 2012
I have Book1 (reference workbook) and Book2 (where i copy values from Book1)
Now I have macro to fetch the datas and paste the values in the format below.
But I can only doing this for one reference workbooks. But i need to add more reference workbooks in a file and paste to Book2. (etc: Book1, Book3, Book4, ....... to Book2)
Book2 looks like:
A1 B1 C1 D1
Name Adress Age Sex
Ozan xxxxxx 27 M
Here' s the Code.
Option Explicit
Sub TransferData()
Dim wkb As Workbook, wks As Worksheet, LastRow As Long
Dim FilePath As String, FileName As String
Dim ws As Worksheet, blnOpened As Boolean
'Change these variables as desired...
[Code] ........
View 3 Replies
View Related
Apr 8, 2014
Would like a macro that will do the following:
- Go into a specified folder (ie. C:data) which contains multiple workbooks
- search each workbook for a column titled SCIN
- copy the cell labelled SCIN and 60 cells below it to a new workbook (summary workbook)
- repeat the process in all the workbooks until all of the SCIN columns have been located and copied into the summary workbook
View 14 Replies
View Related
Aug 4, 2012
I have 17 workbooks which contain similar data and formatting. The only variance is the number of rows of data in each. I want to write a macro in the Master worksheet that will accomplish the following
1. Create a worksheet name in the master workbook with the same name as the workbook that it's pulling data from.
2. Copy over the column headings from columns A:P to the newly created worksheet on the master workbook
3. Copy over all rows that contain the word "down" under column D titled Operational status
The naming convention for the master workbook will be titled "All Switches". The naming convention for the worksheets containing the data are titled Port_Map_on_tiegcsw01, Port_Map_on_tiegcsw02, Port_Map_on_nypgcsw01. There are other names , but I can reference the code an update accordingly.
I found some searches on the forum for creating a macro to copy data between workbooks, but not quite sure how to write the macro for the three functions.
View 2 Replies
View Related
Mar 8, 2013
I have a macro that opens all workbooks from one directory and runs a macro for each workbook to clean up the data. I cannot figure out how to take all those open workbooks and save them to another directory and close the workbook. Also, I do not want the macro workbook (xlsm) to save. I only want it to close. I am working in 2007 Excel.
View 8 Replies
View Related
Jun 27, 2013
VBA Macro to work through a worksheet that consist of static data (tab 4) cost centres and to populate a new work book per cost centre consisting of three tabs for every cost centre found in the static data.
The master Workbook has the following tabs:
Tab 1 is called travel and consist of column a which is the cost centre number (plus 14 other columns)
Tab 2 is called Mobile and consist of column a which is the cost centre number (plus 14 other columns)
Tab 3 is called Expenses. and consist of column a which is the cost centre number (plus 14 other columns)
Tab 4 Static Date column 1 cost centre number and consist of column 1 which is the cost centre number (plus 14 other columns).
If no information found on a specific cost centre, the tab will include the headers and return the words "No transactions for this period"
Whilst splitting data into Tabs the workbooks should check against the Static Data table and include cost center description in Column B of each tab in the new workbook.
If master workbook consist of the following....
Tab 1 is called travel and consist of column 1 which is the cost centre number (plus 14 other columns), cost centres, 555,557,
Tab 2 is called Mobile column 1 cost centre number and consist of column 1 which is the cost centre number (plus 14 other columns) cost centres, 555, 78689,
Tab 3 is called Expenses. column 1 cost centre number and consist of column 1 which is the cost centre number (plus 14 other columns), cost centres, 555,
tab 4 Static Date - column 1 cost centre number and consist of column 1 which is the cost centre number (plus 14 other columns). cost centres, 555, 557,78689
It should output 3 workbooks by cost centre number.
One for 555, which consists of 3 tabs, travel, mobile and expenses.
A second for 557 which has 3 tabs travel, mobile and expenses, but only with data in the travel tab.
A third for 78689 which has 3 tabs travel, mobile and expenses, but only with data for mobile data.
The workbooks will be replicates of the contents within the tabs where column a wil be the cost centre plus 14 additional columns.
View 5 Replies
View Related
Nov 24, 2012
Copy over data from different workbooks and using paste special values to paste it into a new workbook using a macro. Here is what I have and what I am looking for:
My file path is
C:Documents and SettingsMy DocumentsProjectCostsDecember12
In this folder I have workbooks called:
Function1
Function2
Function3
In each workbook I have 4 worksheets
Cashable12-13
NonCashable12-13
Total12-13
GrandTotal12-13
I also have a workbook called DecMonthlyTotal in the same folder with the same named worksheets.
I am looking for a macro to be placed in the DecMonthlyTotal that will pull the data from the Cashable12-13 worksheets from Function1, Function2 and Function3 and paste special the values into workbook DecMonthlyTotal, worksheet name Cashable12-13, it will also pull the data from the NonCashable12-13 worksheets from Function1, Function2 and Function3 and paste special the values into workbook DecMonthlyTotal, worksheet name NonCashable12-13
Both the Cashable12-13 and the NonCashable12-13 have Columns A - G The row that the macro should start the copying from is Row 3 for each of the workbooks; however I don't have an end row for the workbooks as this will vary.
I am using Excel version 2003.
View 1 Replies
View Related
Nov 14, 2013
Macro command to run a macro in all sheets of a workbook
View 6 Replies
View Related
Feb 3, 2013
I have a macro (see below) that simply formats a sheet for printing. I am currently clicking individually on each sheet in the workbook, and running the macro. Is there a way to have it automatically loop through all the sheets in the workbook?
My current macro is:
Sub Set_Print()
'
' Set_Print Macro
'
Application.ScreenUpdating = False
[Code] .......
I have about 10sheets / workbook, and 80 workbooks to do, all saved in the same folder.
View 2 Replies
View Related
Aug 29, 2008
I would like to use VBA to search a folder and copy data from tabs within the excel files there. The data will be pasted to a tab of same name in the the main file. All the files are in the same format.
So far I have only managed to list the files in the folder using code I found on your site!
View 7 Replies
View Related
Oct 18, 2013
I have a macro listed below that I would like to use on multiple sheets within the same workbook.
Sub PrintMacro1()
'
' PrintMacro1 Macro
' To change print format from landscape to protrait
[Code].....
View 4 Replies
View Related
Jun 3, 2014
I have a workbook that I edit daily then pass along to another team. All of my modules are passwork protected and there are also several sheets in the workbook that I hide before email it to the other team. I hide the sheets by changing the sheet properties in the VBA editor to "2 - xlSheetveryhidden".
This isn't a very time consuming process but I am wondering if there is a way to automate it through VBA?
I tried the the fail safe of "see what happens when I record it" but all I got was an empty Module.
View 2 Replies
View Related
Mar 2, 2009
my code to loop through sheets in another workbook does not want to work. in This Workbook (SourceWb), I copy the current workbook using SaveCopyAs and then reopen the new workbook. from ThisWorkbook (SourceWb), I am trying to delete any sheet between "First" and "Last" where a specific criteria is not met. so starting from the For Each to get my loop values, where PMs is a list of people's initials:
For Each c In Range("PMs")
If c.Value = "" Then GoTo AfterArrays
View 9 Replies
View Related
Jan 13, 2009
Could some one amend the VBA below to allow a continous loop on moving to the previous sheet within a workbook. Currently when I move to the first sheet if I use the shortcut key I get a debug error.
View 6 Replies
View Related
May 12, 2011
I have 20 excel files each having more that 1000 records, the format and header for all the files are same.
I need to consolidate all these 20 different files into one excel sheet, having only one header row at the top. Since I need to perform this step frequently, I am planning to automate it.
View 9 Replies
View Related
Sep 6, 2012
I have a large workbook with 10+ sheets i need to protect all at once. I have created a macro in VBA below. It works, but I would like another user to be able to change formatting on the sheets while they are protected. below is my macro.
Sub ProtectAll()
Dim wSheet As Worksheet
Dim Pwd As String
[Code].....
View 1 Replies
View Related
Nov 9, 2013
I have a macro in a workbook that starts with one sheet (called Home Page), the macro opens other workbooks and copies sheets to add to the original workbook. When the macro has finished, I would like for a new macro to include all sheets into one PDF file. My problem the finished workbook will have a different number of sheets in it every time.
View 5 Replies
View Related
May 24, 2006
Well this excel workbook has lots of sheets each for a specific region eg, Europe, austin etc and also sheets which have relevant data that gets used in the formula.
Now, say for eg lets considered the sheet called austin.
it does the calculations on the headcount needed for call center.
so the columns refer to a formula called gets() which then calls the erlanc function.
Now the problem here is this gets() function takes a value called calc
and this calc just a cell in one of the sheets called table. Now if I change the headcount value in the austin sheet nothing happens. Then I need to change the value of calc cell say make it to 5 or 6 and hit enter. It starts calulating the values to forecast thye headcount, but it does so for all the sheets . so it is taking a lot of time.
how to get make it run only for one sheet.
View 9 Replies
View Related
Aug 31, 2006
I need to apply the following code to all the sheets in my workbook (they are all identical format)
rivate Sub mymacro1()
Application .OnTime TimeValue("10:27:00"), "MyMacro1"
Dim objOL As Object
Dim objItem As Object
Dim lngRow As Long
Set objOL = CreateObject(" Outlook.Application")
lngRow = 6
Do While activehsheet. Cells(lngRow, 1) <> ""
If ActiveSheet.Cells(lngRow, 6).Value < Date Then
Set objItem = objOL.CreateItem(0) 'constant olMailItem = 0
With objItem
.Body = "The training review for employee: " & ActiveSheet.Cells(lngRow - 5, 2) & " is due today """.....................
I don't know what syntax to use to 'globalise' if you like the macro to perform the action in the code to all the sheets.
View 4 Replies
View Related
Nov 9, 2006
I am moving some sheets into a new workbook and from the new workbook I want to prompt the user to save the workbook where they see fit. For some reason I cannot seem to save the new workbook only the old with the below code.
Sub Moving
Dim wb As Workbook
Set wb = ThisWorkbook
Sheets( Array("Hk", "Li", _
"SAM")).Select
Sheets("SAM").Activate
Sheets(Array("Hk", "Li", _
"SAM")).Copy
If wb.Saved = False Then
Select Case MsgBox("Do you want to save your changes?", vbYesNo Or vbExclamation Or vbDefaultButton1, "J & R Solutions")
Case vbYes
wb.Close True
Case vbNo
wb.Close False
End Select
End If
View 2 Replies
View Related
Jan 5, 2014
I am trying to modify the macro that I have put together so that it executes only specific worksheets within a single workbook. In this example, I would like the macro to update worksheets A, B, and C but I have more sheets in my actual file. I am only able to get the macro to work on the active sheet. Attached is my workbook.
VB:
Sub HideColumns()
Application.ScreenUpdating = False
Dim myRange As Range
For Each myRange In Range("B5:M5")
[Code] .....
View 5 Replies
View Related
Jun 20, 2014
I have a worksheet with multiple sheets.
Users and Data
In users column A has email contacts from people that accessed a recoding on line. I need to be able to cross reference with another sheet called data where I will have their full name.
Basically I would like a macro that will check column A in users sheet and check in data the name column . If it finds last name or partial name in the mail it will highlight it in the users sheet and in the name column in data
User sheet
Column A is raw 1 is heading username
data sheet
column B is raw 1 Last Name
That way I am able to quickly identify a group of people if they did not watch the recording as user gives me indication on what they did.
View 5 Replies
View Related