Xfer Data B/w Books W/ One Book Having Differ File Name
Apr 8, 2008
I'm transferring data from one workbook to another. The first workbook ('Request Form') will always have a different file name depending on which user is saving it. However, the worksheet within that book will always have the same name ('Tab A'). Workbook and worksheet 2 ('PTS' and '2008' respectively) will remain the same.
Basically I want the macro to open 'Request Form' (whatever the name, wherever it's saved) and stay open as the rest of the macro runs. I need that file name to be a sort of wildcard, since the file path and file name will never be the same. How can I do this?
Dim TabA As Worksheets
Application.GetOpenFilename
Application.ScreenUpdating = False
Set wbOpen = Workbooks.Open("Request Form.xls") --THIS NEEDS TO BE A WILDCARD
'Declares the ClientName
Sheets("TabA").Select
I'm trying to copy rows from one workbook that is exported from access to multiple worksheets in multiple workbooks. I used a macro I found here from JBeaucaire that will copy the data for me but it over writes the information I have in rows 1-3 and also the rows below, 28-35.
Is there a way to copy the data without loosing the information in the first three rows and the rows below where the data goes?
I have eight sheets that have lists of questions in, which I want to copy across to a results sheet if the answer to a question is 'Yes'. Each question takes up rows B:H inclusive, and I would want to copy them to rows B:H in the results sheet. The "Yes" value will be found in column F of each row.
How can I set up a macro to copy the entire rows (without formatting) into a results sheet properly? I've tried every solution I can find but always hit a roadblock somewhere.
Ideally I would like to have a 'populate' button on the results sheet that would find every question that was answered 'yes' across the eight survey sheets and import them into results sheet.
so to start off im not able to attach things due to security reasons, what i need is either 1 of 2 macros. if its possible, both are related. one possible is as follows: i need it to go through a certain column (say I for example) and look at the information in it, this information can vary from peoples names along with dates and other stuff, i want it to look through these and if anything has a date today and prior i need the cell to be highlighted. problem is sometimes it might have 2 dates, or no dates. it should have todays date, their name, other information, and future date of something. but not everyone does, this is the macro i dont think that can exists.
2nd macro possibility the other macro uses the first sheet, AFTER been highlighted, normally by hand, and takes it to another workbook and puts in in certain spots. so the first sheet has names of everyone in column K. what i need is it to look at column I and if its highlighted take entire row to other book, and put into sheet under the person name in their tab. the second book has a tab for each person (at this time 18 tabs) which can fluxuate, and each tab is the persons first and last name, without spaces. since when i put sums on main page it didnt want to work with the spaces i had to omit them. again im not sure this is possible.
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.
I have an excel file which I use when I book keep journals in work. Each time I come across a new piece of bookkeeping I add to the file, name the sheet and index it. (I've attached a loose example for illustration) so the bookkeeping template.xls gets bigger every day.
Currently, when I book keep on a particular day, I open the template.xls workbook;
draft my journals;
and then manually copy the worksheets I have completed during the day from the template.xls workbook and paste the sheets into a new book and save the days bookkeeping as the current date.
With the file I have attached can someone show me how to write a macro and apply it to each of the buttons on the various work sheet tabs (each button will run the same macro).
Upon clicking a button, I would like the macro to;
Copy the active sheet into a new book and save the file as the current date.
Each subsequent click of a button the macro will check if the .xls file exists for the current date, if it does, then it will just copy the active worksheet to the file that has already been created.
In the new file which is saved as the current date, I need to remove the macro button and the hyperlink that reads back to index.
I have had some helpful macro's provided from another forum, however, the other forum does not appear to enable users to upload files, so I can't quite convey what it is I am trying to achieve.
I made the following code to merge 2 workbooks together.
The code is to be executed when the user has Workbook A opened. (All sheets in workbook KPISWD are supposed to be moved after all worksheets in workbook KPICustomers).
I keep getting a debug error on the code that is supposed to do the actual move and loop until it is finished with all of the sheets in Workbook B.
Code: Dim KPICustomers, KPISWD As String KPICustomers = ActiveWorkbook.Name
Workbooks.Open Filename:= _ "W:FacturatieKPI per periode SWD.xls"
I have some code which copies down a formula in a range of data. After this I want it to sort the data by this column in question. However my data range will differ in rows all the time and if I record the sort through the macro method it saves the VB code as a fixed range i.e:
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("A2:A1967" _ ), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal The formula code beforehand does acquire the last row number if that's of any help:
Dim rng As Range Set rng = Range(Cells(ActiveCell.Row, 1), [A50000].End(xlUp)).Offset(0, 1) rng.FormulaR1C1 = "=IF(RIGHT(RC[-1],2)=""XP"",""5"","""")"
i have done a search on this topic and found many similar answers to many similar questions. All specify using Application.Run "workbookname.xls!macroname".
In my code, the filename has an assigned value as the master code goes out to many secondary files - the user selects the particular one they want at the start of the macro. The variable assigned is called "UpdateKAMsFile".
how do i get the macro called KAMsRandomColour to run in the workbook designated by UpdateKAMsFile?
The rows will differ depending on the Active Cell that's selected and I don't know how to specify this. The range I want to copy is from Column B to DA on the worksheet ("Staff") which I want to paste to another worksheet ("Leavers"). This is as far as I got
'FindRemove = lstRemove.Value 'If FindRemove = "" Then End
' Goes to the start of the Data column 'Sheets("Staff").Select 'Range("B4").Select
' Tests current cell against FindRemove 'Do 'If ActiveCell.Value = FindRemove Then 'Call CopyPerson 'Exit Sub 'Else: ActiveCell.Offset(1, 0).Select 'End If 'Loop Until ActiveCell.Value = "" 'End Sub
Got an issue that I can only seem to do with things like the program Hotkey and making physical macros. I'm sure it is easy but I'm lost.
I have data in one book that looks like this (Call it Book1)
Date: Service ProviderReason for callCRM SR #DM SR #WO #Device #Serial #Issue15/02/2010DATE: 03/02/10 TIME: 11:29 BUS: 1234AO ISSUE DETAILS: Issue with Console
and data in another book that looks like this (Call it Book2)
DeviceSerial NumberNameTerminal PositionTerminal Group Location DescriptionTerminal IDDescription Service Provider 104012343030123456ConsoleDriver Console1234AO90401234Service Provider Name found Here
I need to find the BUS: 1234AO from the cell in Book1 then look that Bus up in Book2 and then from Book2 copy the Device, Serial Number, and Service Provider into the cells into Book1 and repeat this infintely often. The problem I have is the the bus can have 1 Console and 1-5 Readers and I need to find that data also. So for example I need to find BUS 1234AO and get the Console details and past that into one issue and the next issue will have the same bus number 1234AO but I need the details for Reader2 (that detail is in the Name field as shown above.) The issue details will always have the Console text and Reader# text in it.
The problem I have is that the Reason for call cell has ALT-ENTER characters in it and the details are not always in the same spot but the details are almost always in the format ####AO (four numbers and the letters AO)
I have done this once already, so I know its possible but I cannot remember what it is called and how to do it.
I have a "form", I open it up, fill out a few different things, and then save and print it. When I save it I want it to take a few different cells information and report it into a seperate workbook, without having to open the report workbook. I use this seperate workbook to reference when I fill out the form and who it was sent to.
I remember there was a wizard that I used to get it to do all this, but I can't for the life of me remeber what it was.
I have a code in which we can split the data using column values into new and same sheet also. I want to modify this accordingly to my need but i am new in VBA so can't modify this. i want 2 changes in this macro:
1. I want to set a value (Like:"Resolved"," In Process" ) in the macro to extract the data related to the value only. Means, when i run this macro it will extract the data only for "Resolved" status. I have to create two macros for each defined status.
2. After splitting, it will ask me to save the new workbook location.
3. Save it.
The codes i m having are :
First code to make directories:
Code: Public Type BROWSEINFO hOwner As Long pidlRoot As Long pszDisplayName As String lpszTitle As String ulFlags As Long lpfn As Long
I need to transfer data from one sheet to another sheet in another workbook. The output row corresponds to a value in input column a, and output column corresponds to a date in input sheet column B.
I've previously dim-ed the input/out workbooks/sheets as wbin, wbout, sheetin, sheetout respectively. The error I get is runtime error '9': subscript out of range in the copy destination line.
iMaxRow = 5000 Dim subj1 As String Dim subj2 As String For iRow = 1 To iMaxRow
[Code] .........
For now, i've disabled the on error resume next. Also, the input column a has 4 numbers followed by string, while the corresponding output row header only has the 4 numbers, hence I tried matching with the wildcard.
how can i make the Test file shown every day with different date.. this 24.02.10 is not permanent.. everyday changes.. meaning tomorrow it checks Test 25.02.10.exe, Friday it checks 26.02.10 etc.
I could make a cell for date input .. and from that cell it could be added up to enter into above formula automatically..
I've had a scan through the archives trying to find a post or item on importing Outlook data to Excel, and have so far only found articles on importing data from users' 'Contacts' lists. I need functionality so that when the user selects an office (e.g. 'London') from a list, further details for those offices - which are stored as individual members of the global Outlook addressbook - for example postcode, can be operated upon.
Because this data is relatively dynamic (e.g. potential for relocation of office premises), I need any procedures to refer to a single unified data source, therefore I'd like any VBA procedures to use data directly from the outlook address book, instead of importing a static copy of the data and then performing operations on this.
find the attached file. Book 2 there is 4 columns ie,reg no,fleet no,product & model and on book 1 there is fleet no,reg no and model and what i need is to capture fleet no & model from Book 1.
I have a cell that I want to use data validation on so I have a drop down list. Problem is the location of this list will be in another workbook.. Is this possible to go from one workbook to another using data validation?
Also, depending on the information that is selected from the drop down list I want a cell to the left to pick the corresponding data from the list in the other workbook. These forms will always be in the same folder.. Not sure if that information is necessary but just in case you need to know.
I have built a data entry form (Input tab) and have code populating a table (Table tab). Currently both are in the same book, but I would like to house them in separately.
What is the proper VBA syntax for this? Will both books need to be open in order to populate the table?
The 'real' data is hosted on sharepoint and is getting darn big. The result is problems opening the doc and looong save times. My thought was to have the secretaries doing data entry open a single sheet (Input Form) which will then populate the data in another sheet. I'm dreaming, aren't I...
I know Access would solve everything, but for cost reasons I am stuck with Excel.
I have managed to use ADO to copy data from a closed book to my active sheet. Problem : it copies only the text, and not the dates or figures...
Code:
Sub TestReadDataFromWorkbook() ' fills data from a closed workbook in at the active cell. GetDataFromClosedWorkbook "H:P&LYE TempDiv P&LP&L Report 020312.xls", "A1:Z1000", Range("A1"), False End Sub
Code:
Sub GetDataFromClosedWorkbook(SourceFile As String, SourceRange As String, _ TargetRange As Range, IncludeFieldNames As Boolean) 'GetDataFromClosedWorkbook "C:FolderNameWorkbookName.xls", "A1:B21", ActiveCell, False 'GetDataFromClosedWorkbook "C:FolderNameWorkbookName.xls", "MyDataRange", Range("B3"), True
I have 4 workbooks that I want to link together. The first three are exactly the same as each other in the setup, cell size ect, ect. The forth book or "book4" is the book that I want link to the other three books. I am planing on using a countif formula to add up certain symbols in designated cell ranges. Eg, Make a formula in Book 4, cell B4 to count all the black triangle symbols "" in the cell range B6 to B35 in Book1, Book2 and Book3 on each work sheet (There is 31 work sheets which represents a work sheet for each day of the month). If I can just get the formula for doing this I can aply it to everything else.
One last question, these 4 books that will be linked togther are used for each month. So every month I save them under a that months name, but if I have the books linked I will always have to keep updateding the formulas in book4 b/c it will still have the formulas for the previous month. Is there a better way to setup what I want to do or will I just have to keep changing the formulas each month as I update?
I am creating a new Excel sheet in a new Book, and I want to reference another cell in another Excel Book. OK I know how to do this. But I want the following cells to "Automatically" get the corresponding cell values from the other Excel Book Sheet.
For example if cell B1 from Book2-Sheet5 gets the value of cell A7 in Book1-Sheet2, and B2 gets that of A8.... I want the following ones to get the corresponding values (B3 gets that of A9 and B4 gets that of A10, ETC...)
I would like to know if there is a way to copy a spreadsheet and paste it into a new tab on another spreadsheet. We currently download 2 lots of spreadsheets from SAP and would like to create another spreadsheet to act as a 'central' preadsheet. What I would like to happen is that the data from the 2 downloaded spreadsheets will be automatically pasted into 2 new tabs on the central spreadsheet, then run some formatting macros (which I can do fine).
We have a master worksheet, and I cant let staff see it, but I want them to update 'their bits' themselves, rather than email the admin staff and let them update the master sheet..
every job is on its own row and contains a unique ID.
is there a way i can merge their data in to the correct row and column(s) on the master sheet?
Firstly... using VBA i'd like to disable any save function to everyone other then me and a colleague on a spreadsheet (The one below).... Is it possible that just the two of us will have the ability to save and no other user?
Secondly... On opening one work book... in this case "Productivity Test" i'd like it to simultaneously open "Productivity Test Back End" both saved in P:MI TeamNew Prod with the back end remaining locked totally.
The reason behind this is these two spread sheet's are linked via sums, productivity test uses the back end as a kind of data source so i'd like "Productivity Test Back End" locked so they cannot see it/amend it..
Maybe i could use a bit of code that updates the link everytime something is used as opposed to having the back end open at all...? What do you think?
The last thing, i have alot of macros that run quickly on my PC, if my manager opens productivity test and uses the spread sheet it appears to run alot slower.
There are alot of tables in Productivity Test that are hidden and only appear when needed while everything else remains hidden. The example below is one buttons code..
ub Selectdsrtablenew()
'Select the correct table for users to view DSR detail'
Is there any way of stream lining the code here to make it smoother as it appears quite a few times in the report for different buttons.. Maybe defining table names?