I have an excel spread sheet with about 300 tabs. each sheet has the same column fields..I need to pull certain column fields ( the same fields ) out of each tab and export them to another spread sheet.
I want to import a CSV file into a worksheet. one of the things i need to do for the import is seperate the data if its a different currency.BUT copy the format from a sheet called "MASTER" which will be hidden. some of the variables are as follows, there will be more
0 = GBP (£) ¢ = USD (U.S Dollar) E = Euro S = CHF (swiss Franc) A = AUD
I have about 1200 text files with data regarding different machines.These file contain a line called 'Validation date" and also the programe number on different line.
I need a macro which will extract this date for each program number and write in excel in two columns like program number and validation date.
I have tried with some of the macro help available on this site,but I have to do this one at a time.The time required doing this way is same as going in each text file and copy/pasting in excel.Is it possible to automate this process.
I would like to use a vba procedure/procedures to achieve the following: I have a folder with many Word2003 forms in and I want to save just the data from each form and then import the data into an Excel spreadsheet.
Currently I am opening each .doc file in turn, saving just the data to a new plain text (comma separated file) in a different folder and am unable code searching that folder for all the text files and importing them into the spreadsheet. I have a two part question to my current approach:
1) I am 99% there with the first part (opening and converting the forms) with the following code having followed advice from another thread but I need Word open and not showing an open document. Is it possible to add code to take care of opening Word in the background and close it again after so the process is fully automated?:
I've only recently ventured into the VBA scripting and am finding it quite exciting. After doing some trivial stuff, I'm trying to work with websites. Currently, I'm trying to pull data off of a website which poses a form which has to be filled first. I've been successful in filling the form and clicking submit, through the code, but the site opens the results in a separate tab in IE. I am unable to make it go to that tab and copy-paste data from there.
Secondly, instead of just blindly copy pasting, it would be better if the data is pasted in a more readable format (as on the website). The following code is plainly copying and pasting the data as-is and hence rendering it unreadable:
I'm not very good with macros and I need to create a macro that copies data from one excel worksheet into multiple other worksheet tabs in the same workbook. I have 8 columns and thousands of rows of data. The spreadsheet is sorted by column E.
In column E, there are about 25 different values going down throughout the spreadsheet. I would like the data for each of these Column E categories to be copied over to a new tab in the spreadsheet with the tab name as the value in E. So in the end there would be the main tab, and then 25 new tabs with the filtered data. Does anyone already have a macro that will do this?
I have a spreadsheet with 12 tabs, 1 for each month in the year. On each tab I have employee names (column A), followed by the premium they pay for their health insurance (column B). I'm attemting to create a list of each employee and how much they paid for helath insurance over the year. Since employees come and leave thorughout the year, the lists aren't the same on each tab. However, I was able to create a master list of all possible employees and placed this list into a new tab.
I'm vaguely farmiliar with the SUMIF function and I believe that this would be the best approach, or some possibly sort of vlookup.
I've been asked to compile and sum weekly sales data. The problem is that the data was supplied in 52 separate tabs, for each week of the year (I don't know who on earth thought that would be the most appropriate way to send the data).
Is there any quick way to import all the data from each tab into one worksheet? The data is laid out the exact same way on each tab. All the row and column headings are the same, and in the same cells. Only the numbers are different (obviously).
I have a summary tab in which I am trying to sum data based on specific variables from 30 other tabs in the worksheet
- In the summary tab, I have months (one year worth) over the top row and consultant names in the first column - Each other tab represents a project - I want for consultant 1 in summary tab, to have: For january, the sum of dollars spent in january in each project (so across all tabs) Same for february to december.
I have attached an exemple Note that the consultant names will always have the same syntax but will not necessarily be in the same cell in each tab.
I need to split up the "master" table so that for all rows where DOL1 falls with a year range of e.g 6th April - 5th April (in any year) then this row is moved or copied into a new tab based on the year range.
i.e. The first row should appear in a new tab for the range 6th April 1978 - 5th April 1979. The marco should be ale to create and name new tabs. The tab name will be 78_79.
The second row should appear in the 87/88 tab.
I have several thousand rows of data with dates ranging from 1978 - 2012 so there should be tabs populated for every year from 78-2012.
I have imported data into excel arranged as per the following and there are separate tabs per year. I a trying to summarize and phase the balances per client..i.e 07,08,09,10,11,12.
Therefore if client x balance in 2007 = 10, 2008=11, 2009=10, 2010=2, 2011=3 and 2012 = 5 and so on...then total the balance owed as of now and also phase it as illustrated below. I've tried vlook up's?
I had a friend attempt to help me with this issue but he couldn't figure it out. He suggested that I tried asking around here.
Here is what I am trying to accomplish: (I am happy to email anybody the spreadsheet to help out with this description)
1. There are two spreadsheets. One spreadsheet with about 25 tabs (one for each store number) and one spreadsheet with one tab and about 1400 lines of information that is sorted by store number. To preface, this 1400 line spreadsheet can be 900 lines one month and 2500 another month, so it fluctuates.
2. From this spreadsheet sorted by store, I will highlight, cut and paste into the corresponding store tab on the first spreadsheet. Also, at any given month, the information fluctuates, it can be 15 lines for one store one month and another month it could be 5.
3. Once I am done cutting and pasting it all into each seperate tab, I have a 26th tab that I am looking to create a button that will then pull all that information into the 26th tab.
I know - first question is why would you want that? You already have all the information from that original spreadsheet. Well, in these store tabs, I have everything perfectly formatted a certain way and I only really cut and paste the information that I need from the 2nd spreadsheet.
I have a spreadsheet that my friend claims he got close to working it out.
Just to add, I would need this button to take into account that the information in each tab fluctuates and also that it is easy to add a tab if I add stores.
I have a spreadsheet with multiple data tabs feeding a few summary tabs.
For this question I will deal with one summary tab and two data tabs, one data tab for sales and one data tab for service. On the summary tab, I want to look at vehicles sold during a certain time period-(looking to the sales tab). For each of the records in the sales tab that match the date range, I need to count the repair order activity on the service tab. The key between the summary and sales tab is the sales date, and the key between the sales and service tabs is the vehicle serial number.
I currently have multiple columns on the sales tab to perform the counts from the service tab, thus allowing me to pull the information to the summary tab. Problem is that the spreadsheet has over 2 million calculating cells and tends to take excessive amounts of time to recalc.
I have 5 cities and each city has a set of data in separate tabs. Right now i have data pulled for all 5 cities in a single sheet but its too cramped up..
I want to use a drop down list (data validation) and if any of the 5 cities are selected in the drop down, the data from that particular city (tab) should be pulled up. This way my sheet size will be reduced 5 time which will look good.
A common v lookup wont work because the data has to be pulled from 5 different tabs for 5 different cities.
1. The idea is that the macro will start on sheet1, look at column "Jon", copy the values down to the last active cell as well as the dates and paste special values and transpose them onto the "Jon" tab starting in B8 and B9. Each day all of the dates and values on the "Jon" tab should be overwritten with the data on sheets1 and 2, instead of it being cumulative.
2. The macro will then go to sheet2, look at column "Jon", copy the values to the last active as well as the dates and paste special values and transpose them onto the "Jon" tab starting in B18 and B19. Each day all of the dates and values on the "Jon" tab should be overwritten with the data on sheets1 and 2, instead of it being cumulative.
3. The macro would then save the "Jon" tab as a separate pdf in a specified location.
4. The process would then repeat for "Mike" and "Paul". Each day the number of columns can fluctuate, so it may be 3 one day (Jon, Mike, Paul) and 8 the next. The number of rows also may vary from day to day, and column to column.
I have attached a workbook that contains the data for the scenario above as well as the output (Jon, Mike, Paul tabs). Ideally there will not be new tabs that remain for Jon, Mike, Paul, just a default tab (e.g. "output" tab) that would receive the transposed data from the columns for Jon, Mike, Paul. I put all 3 in the workbook so you could see how each of them would output.
I have part of macro to import a txt file into excel but it is not working as it should. It is giving me a message "This file is not a recognizable format" but its just a normal txt file. Also after it gives me this warning it will open in excel and with every new txt file it gives me this warning and after it opens it.
The code I am using is:
Sub su() Dim oWbk As Workbook Dim sFil As String Dim sPath As String sPath = "C:Historical" 'location of files ChDir sPath sFil = Dir("*.txt") 'change or add formats Do While sFil "" 'will start LOOP until all files in folder sPath have been looped through Set oWbk = Workbooks.Open(sPath & "" & sFil) 'opens the file Workbooks.OpenText (sPath & "" & sFil), Comma:=True, DataType:=xlDelimited ' do something sFil = Dir Loop ' End of LOOP End Sub
In this line it gives me Runtime error 1004 Method 'Opentext' of object workbook failed: Workbooks.OpenText (sPath & "" & sFil), Comma:=True, DataType:=xlDelimited
I have a workbook that contains over 100 worksheets with stock data and price information. It uses a screenscraper to update the workbook each day with the latest day's price, and then exports each of these .csv files into a local directory. The macro for this is working. In effect it is generating a price history file automatically in my absence for me that can be read by charting software.
What I would like though is a macro to loopthrough and backfill missing price histories on each worksheet. I have a source of .csv price histories already, but would like to avoid having to cut and paste each of the 105 files manually, as it may become a regular occurence.
Each worksheet that requires backfilling has the stock code in the cell "A2", so that can be used to search for the filename Range("A2") & ".csv"
This is as far as I have got - however it results in a runtime error (91) Object variable or With block variable not set, pointing to this line:-
I am troubleshooting my macro that seems to cause a data shift with the Letter "F" when I import multiple CSV files into one spreadsheet. When I go outside of the macro and record a macro and import the CSV into a workbook it works perfectly fine. But there must be something in this code that is causing the shift:
VB: Private Declare Function SetCurrentDirectoryA Lib _ "kernel32" (ByVal lpPathName As String) As Long Public Function ChDirNet(szPath As String) As Boolean Dim lReturn As Long lReturn = SetCurrentDirectoryA(szPath)
I have attached an excel workbook that shows how the macro imports vs. a regular import. Why "F" is causing a shift in the data.
i want to import data from multiple excel files (with same kind of data) into a master file with each import want to display name of the file from which the data is imported in last column on all rows. for example if file 1 has 10 rows with file name abs, after import the macro show display on all 10 rows in a blank column abc. then import second file and its name and so on.
This is a great bit of code (I found), to import multiple text files.
I have one small issue -
currently it imports with each file going to a new column, like this: text file1 A1:A4, txt file2 B1:B4, txt file3 C1:C4 etc etc
And eventually i risk running out of columns because I'm working with a lot of text files.
Can someone tell me what to do to modify this code so it imports like this? : text file1 A1:D1, txt file2 A2:D2, txt file3 A3:D3 ETC ETC
.e.g. first file imports across row1, second file across row2 etc
Sub test2() Dim myDir As String, fn As String, ff As Integer, txt As String Dim delim As String, n As Long, b(), flg As Boolean, x, t As Integer myDir = "\BP1MELIS001SHARED_DATAEVERYONESolutions IntranetPriceMasterlogs" '
Is there a way to automate the importing of macros into a list of files ? I have a number of files that I want to add some code to and was wondering if this could be automated as opposed to adding the code to each file manually as it's going to be a regular job.
I've written a routine to loop through the list of files and open them, I just want to know how, if possible, i can automatically import the required macros.
I want to import an excel file that has multple columns, however, the first column contains both the Group name and the dates. Is there a way to import this into a table to have each record populate the group to the corresponding date?
BASE Researching Duplicate 11/23/2011 21
E-Team General Pool 11/23/20112120 11/25/20112318
General Pool for SB Activations 11/23/2011429418 11/24/2011251125 11/25/2011485452 11/26/2011452410 11/27/2011415408
I know similar questions have been asked before, but I couldnt work out how it is done. Basically I have several xls files with the same name, eg. "test" with an alternating number at the end. 1 - ....
each of these workbooks contain several sheets but all books are the same just with different information on it. each workbook has got a summary sheet in it, i want to import all summary sheets into a single workbook called summary. but each sheet should be imported as in individual sheet.