i made a macro that uses a form with a "browse" button to open a text file and put every word in this textfile in a single cell but i had a problem when copying the address of the file to a textfield, here's the code :
I have 3 text boxes from which at least one must contain a value. The sum of these 3 text boxes must be equal or smaller than the value in another text box. I have written the code but somehow my validation is not working always. Even though the sum is less than required I get the error. Something must be wrong with the code.
Code: With frmManifest If .txtNum1.Value > .txtRough.Value Then MsgBox "Expected Recovery Value is greater than Rough Recovery Value. Please check your value.", vbExclamation txtNum1.Value = "" ElseIf .txtNum1.Value + .txtNum2.Value > .txtRough.Value Then MsgBox "Expected Recovery Value is greater than Rough Recovery Values.
I am creating a training document for work; the sheet I'm creating is a summary sheet which works out how many people answered questions correctly, incorrectly (bringing in from another sheet), number of questions answered and percentage of correct answers.
Looks like: Correct: =COUNTIF(sheet1!E2:E36,"correct") Incorrect: =COUNTIF(sheet1!E2:E36,"incorrect") Number of questions answered: =SUM(C4+C5) (correct+incorrect) Percentage right: =SUM(C4/C6) (correct/number answered)
I need to drag these 4 formulas down into another 400+rows, however in the correct and incorrect formulas I need it to keep the 2:36 but change the e to f, g, h, etc.
I have an excel template that needs to be copied multiple times and each sheet needs be named according to a list in an excel spread sheet. I also have a formula in the template that needs the value copied instead of the formula.
I got this script from an site and tried it. It runs but I don't see any spread sheets.
I want to create a web address for the attached file and then post the link on my football forum so that members can view the file in their browsers. Is it possible to do this?
I've been trying to use combo boxes to open, then copy and paste information from specific worksheets the user requests. So far, my approach has been unsuccessful --and the suggestion to simply use the GetOpenFiles procedure was helpful but failed to address more than the "open files" part of my application. Can variables be part of an excel file address as I've tried to use them in the "strFile =" statement immediately below?
Public strFile As String Public strSheet As String Public strSheetName As String
I have a list of about 300 addresses that I'd like to be able to put in a sortable state. In column A1-A4 is the following:
Name Street Address City, State Zip Email Address
Then there is a blank row and then the next address. What I would like to do is figure out a way to take the info in columns A1-A4 and move them horizontally to A1, B1, C1, D1, respectively. Sure, I could cut and paste, but it would take me forever. I tried a macro,
I'm really looking for a way to get the full address of the external file by specifying the file name in a cell and then evaluate the formula. For example,
[Code] .....
is the full address of the source file called 'Source'. My idea is: if I just type the file name 'Source' in a workbook's cell $A$1, and in cell $B$1 I want to make the formula something like:
="C:Users["&$A$1&".xlsx]Sheet1'!$F$1"
This will make my project very impressive with this feature: a user just types the file name to establish the link and evaluate the formula for results.
What I need to do is put data that I get on a variery of excel speadsheets into a standard template. I can do this by the process of copying over column by column the appropriate detail from one workbook to the other.
what I'd like to do is replicate the column headings of the template onto the workbook with the original data so I'm looking at just one workbook all the while until I'm ready to transfer all the data in one go.
I realise I can just copy from the template to the active workbook, but what I had in mind was having the ability to hit a button to replicate it associated with a macro.
So the macro I'd want would involve starting from a cell in the active workbook, obtaining a named range from my personal workbook (which would be the template headings) and then pasting this back into the active cell of the active workbook.
And if it is feasible...how would I get it to work (taking into consideration the Personal workbook may be hidden).
I have been asked to fix a macro that is supposed to search column B and find any cells ending with .mov. Any row fitting the criteria is to be copied to Sheet2. The file is a internet traffic log and we are trying to determine the number of downloads we have on our video files, which are all .mov format. Sheet1 can exceed 3000 rows.
I want to copy the sheet named "data" from closed workbook (xlsm, xlsx, xls) via ADO.The closed workbook will be choosen by user via dialog box. The code must check the existence of "data" sheet. If there is no, then the code must give a warning. Futhermore, which is able to give a warning against the mistake of selecting the file itself.
I currently have a code that copies (when both workbooks are open) the status report tab from one workbook to another. So, my code copies the entire "Status" tab from Report.12102012.xlsx to Master_Report.xlsx.
But, there will continually be new Report.(DATE).xlsx files that are being made and I would like for my code to be able to search for the newest date "Report" spreadsheet, open it (so employee doesn't have to find the newest spreadsheet), and then copy the "Status" tab to my Master_Report.xlsx file.
All of the "Report.(DATE).xlsx" files will be stored in the same folder.
I have a database that needs breaking down in order to fulfill a request.
I've been trying to create a macro to copy one row to a new workbook (starting from row 3), file name save as a value of the cell (C1), and move onto the next row. However, my code appears to only loop through 26 entries and then stops.
I have about 100 files with using date as file name (ie. 08.20.07.xls, 08.21.07.xls, 08.22.07.xls....etc) Each file contain exact same # of fields (Columns) but varying number of rows. I would like to have a macro in my "Consolidated.xls" file to go through each file and put them into a single sheet with the first column as date field (source file name)
Example:
08.20.07.xls contains
First Name Last Name DOB John Doe 11/1/77 Jane Doe 12/1/78 "" "" ""................
I have an external file that is a table with 4 columns and about 25 rows I would like to copy the contents of a file into a collection so I can analyze the data.
The problem is, I only know how to copy a whole line as a string and have no idea how to copy the data from the same line into different variables. I also have no idea how to define a collection array
I will explain
say my text (data.txt) file looks like this:
AB 0.5 20 2/2/07 CD 0.2 15 2/2/07 FE 0.4 40 2/2/07 (example of input)
I would like to create a collection called trade which I have defined like this (obviosly wrongly) Dim Trade() As Collection Dim bs As String Dim quant As Long Dim price As Single Dim calendar As String Trade.Add (bs) Trade.Add (quant) Trade.Add (price) Trade.Add (calendar)
so I would like to know how to define the collection array and how to input the data so that I don't have to insert a whole line into a string variable but can, instead break apart the line during the input stage
I have a macro that copies long decimals (11 places) from an Excel file to a CSV file. However, the long decimals often get truncated from 11 places down to 3 or 4. I've tried a number of different coding methods to combat this, the most recent and most successful of which is shown below
I'm using Excel 2003. I've got two different .XLS files, each with multiple sheets.
I'm trying to create a macro which will copy a range of cells from one sheet on one .XLS file (which is closed) to a specific place on a specific sheet on the current .XLS file (which is open).
So for the sake of argument:
I've got two Excel files: C:ApplesOldFile.xls and C:OrangesNewFile.xls
OldFile.xls is closed -- NewFile.xls is open and in front of me.
I'm trying to copy the data in ranges B6:C41 and F6:F41 from Sheet2 in OldFile.xls to the same ranges on Sheet6 in NewFile.xls. There are no formulas in these cells -- just data (numbers).
I keep getting error messages, failures to copy to clipboard, etc.
I just wrote two macros that each produce separate text files (call them 'A' and 'B'). I want to open 'B' with Excel VBA, copy all of its contents, and paste that content into 'A' right after a specific location in 'A' (where I have 10 consecutive asterisks, i.e., **********).
Most topics relating to Excel VBA and .txt files have to do with either importing / exporting into Excel (not what I want), or with associating .txt files to Excel (also not what I want).
How to copy a formula (16 columns) from a workbook to another, without referencing the source workbook.
Some people are using tricks such as replacing the equal sign "=" for another character such as "^" then using replace all to put the equal sign back again... but this is too much trouble.
How do I write a vb macro that copies everything from multiple files, including sheets within files, and puts them into one master file. Here's what I have so far. I used a script from gnaga that worked great but it didn't copy seperate sheets. If you can help me out, I would greatly appreciate it.
Sub MergeSheets() Dim SrcBook As Workbook Dim fso As Object, f As Object, ff As Object, f1 As Object
Application.ScreenUpdating = False Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.Getfolder("C:Temp") Set ff = f.Files
I have about a thousand Excel timesheets that all contain 'hours worked' data in a column. Each row contains the area of the project they have worked on and therefore the amount of time they have spent on it. The timesheets also contain the person's name and a w/e date.
I want to sequentially work through each timesheet held locally in a single folder and copy the person's name, w/e date and the hours held in the column into a single new spreadsheet. I need to transpose the data so each amount of time spent on an activity ends up in a column.
I have attempted to record a macro for this but each time I try and run it after the intitial run, it moves to a completely different cell or set of cells to the ones I have directed it and consequently there is no data copied to the new sheet.
I believe this is the first problem..! The second is working through a high number of spreadsheets held in a single locattion but whilst browsing this site I saw the "Excel VBA Loop Through a Folder of Excel Workbooks" page and think this should work fine.
I am struggling to find a macro which can look at a name in column 'BT' and search it in the address book of Outlook to then place the email address of that person in column 'ED'
There are 35,000+ people in the address book and there may be over 5 email addresses for one name, so is there any way a message can appear for the user to select which email address is correct if there is more than 1 contact for that name?
Assume the following list of addresses are all in separate cells of a single column (A1-A4). I just need the formula to extract the street addresses, and then a separate formula to extract the zip codes.
5430-44 PASCHALL AVENUE PHILADELPHIA, PA 19143 OPA/BRT#: 884350845
4010 MARPLE STREET PHILADELPHIA, PA 19136 OPA/BRT#: 651087200
2618 SOUTH HOWARD STREET PHILADELPHIA, PA 19148 OPA/BRT#: 391251216
5737 WOODCREST AVENUE PHILADELPHIA, PA 19131 OPA/BRT#: 522155600