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?:
This is the text file: Video.txt. I import it using the following settings: "Delimited" as Original data type and "Comma" as Delimiters, with all the other settings left to default. Everything is imported into a single row. It is supposed to be a table, with Stk_No, Title, Certificate, up to In_Stk as column titles; then, all the rest should come below the column titles as rows (they seem to be separated by 5 commas). Am I missing a setting or there is a problem with the text file?
I have an master excel file with 20 sheets with names x,y,z,a,b,c,f,.... Each and every sheet has data which start from Row 7 and Column 2. Now i need to consolidate this data in one sheet in another excel file.
Consolidation should be like
Suppose X sheet has 20 rows and 4 columns of data which starts from Row 7 and Column 2, this data has to be copied and pasted in my new excel file copied on my desktop. Now first 20 rows are occupied in new excel file.
Now code should move on to master excel file Sheet Y which has 45 rows and 4 columns of data which starts from Row 7 and Column 2,this data has to be copied and pasted in my new excel file from row 21, which means Master excel file sheets has to be clubbed to one consolidated excel file.
In All the sheets in Master file Data starts from Row 7 and column 2.
Data range varies row wise in each sheet but column length is fixed to 4.
I have bit of code that opens an external excel file (call it the source workbook), grabs certain data, copies the data to other excel file (call it the destination workbook), and then closes. I have most of the code completed but am running into an issue with how to grab certain data from the source workbook and copying it to destination workbook.
I want the code to read the data in the source workbook line-by-line.
For each line that is read, I want to copy part of that data (value in column A and column B) to column A and column B of destination workbook only if the value in column D is equal to “Block”. For column C and column D, I want to do some form of lookup, being I want the code to look at each line of data until it finds corresponding line in which column A = “60612105” and in which column B = the value in B. Once this line is found, copy the value in C to column C of destination workbook and value in D to column D of destination workbook.
I have attached two files. First file is the import file (destination workbook) which has two tabs; (1) import tab (2) desired result. Second file is the raw data file (source workbook). Hopefully this makes since.
I have a group of CSV files that I will need to periodically import and sort in Excel.
The CSV files will contain one column I wish to use (It is the first one and the rest can be ignored or imported) and sort the desired data based upon the existance of a particular bit of text. Each entry will either be just a username or a username with a '-label' appended to it so for instance each of the CSV files might contain:
bob fred mark-label ted angie-label
Basically I want to seperate the names with the -label from the ones that do not have the -label. Doing searches, I was able to get part way using the code from this thread:
But am running into problems trying to modify it to suit my needs. Is there an easy way to accomplish this? I'm not very good with VB so that hasn't helped me. It would be nice to move the sourted output to seperate columns if that is possible.
I am trying to have the total (cell e78) from one of my own excel files automatically filled into a cell in a different excel file when the number of that file is typed into a third cell. i.e. if the total on Ticket 4126 in cell e78 is $4500, then when I type 4126 into the Ticket # cell on my seperate Invoice I'd like it to fill in the third cell under Amount as $4500. Is this possible?
An example of the html file (stripped down to nothing but 3 peices of data): [URL]
I wanted to see if there is a VBA code to do the following :
a) Select a TabText Delimited file based on a criteria b) Import the Selected Data to Excel
I have the vba code where I can open the tab text delimited file in excel, use a selection criteria and then copy the data into excel. But I am having problems with the case where the Tab Text Delimited file exceeds the row limit that excel currently has and wanted to see if the data import can be done without opening the text file into excel at all.
I have a number of large CSV files with approximately 1.9 million rows, (this is more then excel can bring in). I typically have to import/delimit the files when brining them into excel. However, when I try this I get the message not all data imported. I would like to be able to split the records in the csv file to multiple tabs in the excel woorkbook when doing the import/delimit but do not know how to accomplish this. The delimit of the data varies each time due to the nature of the data so doing a macro is more trouble to create each time. Currently I am having to open the csv file in notepad and split it up into multiple files then import each new file seperately.
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 have a template that I wish to distribute to others. It will link to a second file (also distributed by me) that will be in each users' "My documents" folder (or "Documents" in Vista). I currently have the template set to look at "C:" as that is common for everyone. Turns out that creates other problems. However, now each user's file location will be unique due to the path of their documents folder
Question, is there a robust way to automate the finding of the linked file in the template without having each user "relocate" it? Reason is the template will be updated frequently and I want to ease their pain by not making them go through this every time.
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.
Below code is for splliting text file into multiple excel worksheet. I want to modify it to splitting text file into different msword documents in folder. Is it possible to change the code
'Dimension Variables Dim ResultStr As String Dim FileName As String Dim FileNum As Integer Dim Counter As Double 'Ask User for File's Name FileName = InputBox("Please enter the Text File's name, e.g. test.txt")
The reports I build work from a basic template with 10 or so separate, slightly different versions. In order to make them I currently update the data in the template and then click on "File>Save As..." ten times, renaming the file as appropriate.
Overall Report for yyyy/mm/dd Partner A report for yyyy/mm/dd Partner B report for yyyy/mm/dd ad nauseum..
Is there an easy macro that could save and rename my file multiple times? It would need to accept manual input for the date. Preferably it would be something that I could easily tweak to change the filenames and number of reports saved as this is most of what I do.
I have a worksheet entitled 'Data'. In this worksheet there is a table consisting of 4 columns plus relevant data:
Project Benefit Type Delivered or Enabled Benefit
PJ1 Financial Delivered Saving of $4M over 24 months.
I have been trying to create a formula that will enable me to pull data from the 'benefit' column(column D) so that the cell contents populate in a single cell in a table in a different worksheet.
Financial - Delivered Financial - Enabled Tech - Delivered Tech - Enabled Green - Delivered Green - Enabled
So, as an example, I am hoping that a formula can be created which pulls the text from relevant cells in column D when criteria from columns A, B and C are met e.g. Tech benefits that are Delivered in PJ2 would populate cell E3 ('Tech -Enabled') in Table 2 with:
I have attached a spreadsheet with a small indicative data set to assist in understanding. I am trying to count the number of documents each individual has assigned to them that are not yet 'completed' (ie REGISTERED, IN WORK, REVIEWED). The problem I am trying to overcome is that the document state can be 1 of several values indicated in the same column.
I have tried using this SUMPRODUCT formula: =SUMPRODUCT((($E$2:$E$11="REGISTERED")+($E$2:$E$11="IN WORK")+($E$2:$E$11="REVIEWED")*($B$2:$B$11="Jones"))) but it is generating incorrect values!
Specifically: - Jones shoulld return 1 - Franks should return 3 - Smith shoudl return 0
I'm trying to create a macro that will save backup copies of documents that have changed when a user closes them. I created an add-in and put a Workbook_BeforeClose sub in "ThisWorkbook" that saves a copy of the document in a temp location on the hard drive.
If I have three Excel documents opened and each one has changes and I close Excel (with the "big red X") it only seems to call the Workbook_BeforeClose once backing up one of the files. If I use the "Close Window" (the "little X") it doesn't call that event at all.
Is there a better event to use or a better way to backup these files when closing them or Excel?
I'm a relatively competent VBA user to a macro recorder and basic editing of custom code level but fall short with writing custom code and don't have much used or proven code I can copy from.
Problem: I'd like to automate a process whereby consolidating certain information within many data files (possibly up to 500) into a single tab within a master file.
At the moment there are only a few data files which are manually consolidated by way of manual links but going forward it will increase significantly, hence the need to automate.
I need to consolidate the following 5 cells from each data file A1, A2, A5, A7, A8 (vertical) into a single row within the master file across 5 columns (horizontal), i.e. each data file will populate 1 row in the master file, one below the other. If there are 500 data files there will be 500 rows of data in the master file.
The data files will be saved in a central location on our server and the master file will sit outside this folder, possibly in a subfolder.
Something which would be handy is a link in the master file to each data file, i.e. if I click on a data row in the master file it would jump to the source data file.