Call Macro In Book Two From Book One
Aug 29, 2007
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?
View 9 Replies
ADVERTISEMENT
Jul 16, 2014
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.
View 6 Replies
View Related
Jul 18, 2014
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"
KPISWD = ActiveWorkbook.Name
[Code] ..........
View 3 Replies
View Related
Jun 22, 2007
I have the below code, which now looks to see if a file is open or not, if it is, then copy and past 'Data' and if not open the book and copy 'Data'.
I think the code is sort of right, but im missing something, as i keep getting runtime error when i try and copy. Here is the
Sub PrintSaveKPIUpdate()
Dim sFilName As String
sFilName = "C: estCashSales_KPI.xls"
Set Main = ThisWorkbook
If IsOpen(sFilName) Then
' Book is Open.
Worksheets("Setup Data"). Range("Data").Activate
View 9 Replies
View Related
Aug 20, 2009
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).
View 3 Replies
View Related
Oct 7, 2007
I have a macro that I would like to run on every worksheet in my book (over 100 sheets wide). As it takes about 20 secs to run on each sheet, and I don't want to click from sheet to sheet, how can I make it run on every sheet in the book? And no, they aren't named sequentially, either alphabetically or numerically.
is there a function in Excel to return the number of sheets in a book?
View 9 Replies
View Related
Oct 6, 2009
I'm having an issue with a macro that copies sheets from one workbook into a new workbook. The issue is it doesn't copy all the sheets. It only copies the first 10 and doesn't capture the the remaining 15. I've checked the range of the translation table and the issue doesn't appear to be there.
Sub SBGFiles()
Application.Calculation = xlCalculationManual
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Dim a As Worksheet
Set a = Sheets("Input")
Dim Fpath As String
Fpath = ThisWorkbook.Path & ""
Dim SBG As Range
Dim RU As Range
Run ("UnPro")
For Each SBG In a.Range("B44:D44")
Workbooks.Add
newbook = Workbooks.Count
Workbooks.Item(newbook - 1).Activate
On Error Resume Next
View 9 Replies
View Related
Dec 22, 2009
I need a macro that will copy specific columns from one book into another workbook.
I imagine this isn't too hard, but i can't seem to find the answer.
Also, i have another macro at the moment which allows me, when i run it, to select the workbook which i wish to copy the columns from.
View 9 Replies
View Related
Nov 25, 2013
I have a macro that used to create a new book for each of the worksheets in a workbook that would name them the same as the worksheet.
Since our company upgraded to Windows 7 the macro, more often than not, fails to work.
The code for the macro is
Code:
Sub NewBook1()
'
Set wbSource = ActiveWorkbook
For Each ws In wbSource.Sheets
ws.Copy
Set wbDest = ActiveWorkbook
wbDest.SaveAs strSavePath & filePrefix & " " & ws.Name & " " & fileSuffix
wbDest.Close
Next
Application.ScreenUpdating = True
'
End Sub
View 5 Replies
View Related
Feb 28, 2009
I have several similar documents open. They each have a macro with the shortcut CTRL + SHFT + T. The problem is each macro is different for each book. When I am working on book X, I don't want macro from book Z to run, but it does.
I need all of them to be open.
View 9 Replies
View Related
Apr 2, 2007
I need to get this macro to process the cells for every worksheet in a book rather than just the active one
Public Sub test()
Dim Lr As Long, i As Long, x As Range, _
v1 As String, v2 As String, v3 As String
Set x = ActiveSheet.Cells.Find("*", searchdirection:=xlPrevious)
If x Is Nothing Then Exit Sub
Lr = x.Row
Application.ScreenUpdating = False
For i = Lr To 1 Step -1
v1 = Cells(i, 2)
v2 = Mid(Cells(i, 3), 1, 1)
v3 = Cells(i, 4)
If v1 "OP00" Or v2 "L" Or v3 "CC" Then Cells(i, 1).EntireRow.Delete
Next
Application.ScreenUpdating = True
End Sub
View 9 Replies
View Related
Sep 6, 2008
At job, Mac OSX and Address Book 4.0.6 with contact info including in many cases emails. I'd like to get it of there, into Excel to manipulate, and ultimately into a FileWrecker Pro database. How to export 1087 entries from Address Book including only selective data fields is the question, and I know that's "slightly" OT, but I do want to import into Excel, so I hope that vindicates me! If not, and you can point me to a good MacForum, I'll settle.
View 9 Replies
View Related
Mar 17, 2009
Is there a way to run a macro automaticly on a closed work book every Friday ? I've found ways of doing this using on-open event but It made me wonder if this was possible.
View 9 Replies
View Related
May 20, 2013
Macro to highlight a cell A1 every monday ( or any day) when we open the book for the first time.
Macro should not run when we open the book from the next time till that week gets over and again it should run once the next week started.
View 1 Replies
View Related
Nov 22, 2009
I am currently using a macro to copy a sheet from a closed workbook in to my current workbook. However this copying is based on the sheet name. At present when I run the following code
View 11 Replies
View Related
May 22, 2014
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?
View 1 Replies
View Related
Dec 23, 2013
I have a large amount of data on NBA teams and players that is extracted from external web pages. In order to have the data shown on separate sheets to do comparisons I have to use many array formulas and from what I have read that takes up a large amount of memory. I'm now at the point where I'm receiving a message that says "Excel cannot complete this task with available resources" when I open the workbook.
Is there any plausible way that I can resolve this situation? I have thought about converting the lookup formulas from arrays (index/match) to vlookups and hlookups.
I'm not as advanced with using Excel as most of you, and I realize I may be at a point to where I will need to use different software to analyze my data, but I would prefer to stick with Excel as it would be difficult to start from scratch and learn how to use a different program.
View 3 Replies
View Related
Sep 8, 2009
I am looking some suggestions for a good book i can buy online to learn about writing VBA for excel. I find this forum very useful for help on solutions to write VBA code but i would like to learn the basics so i can understand what it is i am adding into my excel files. Moderators... If this breaks the forum rules (i've read them and can't see anything).
View 3 Replies
View Related
Sep 30, 2009
I Have been working on a spreadsheet for attendance recording. I will be keeping a new one for each month. I need to be able to take accumulated data from one book and put it in the new one. I have the Following
View 2 Replies
View Related
Sep 11, 2009
What do I need to do to get my vlookup formulas to look into another workbook(or excel file) without having to open it up.
Here is a sample of formula that I have:
[=IF(C13="","",VLOOKUP(C13,Data,21,))]
View 14 Replies
View Related
Aug 16, 2008
I have data like this:
Sammi Alvarez-Vegan
1201 E. Ponce De Leon Blvd.
Coral Gables, FL 33134
Angie Penns
6870 SW 44th Street
Building G28- #110
Miami, FL 33155
Some names and addresses are 3 lines and some are 4 lines. All have a blank line between. There is a double blank between different name blocks.
I tried to Concatenate so all parts would be in B1 cell. =A1&","&A2&","&A3&","&A4&","&A5&","&A6&","&A7
That did what I wanted for B1, and when I copied it down, B2:B8 was part of an address.
It was not until B9 did the actual next name come into play.
I know there must be a better way
I am using WindowsXP and Excel2007
View 9 Replies
View Related
Aug 14, 2006
I am generating Excel reports (with different names) using VBA. The problem I'm having is that for a certain macro, it needs to create a new book, and then activate the original window. But because all the new reports have new names (but using same macros), the name written in code doesn't equal the book's new name. How can I set a variable to be the book name? I do know that the name of the original book will be equal to two letters plus the value in A7. The problem is this: I have written a macro that shows the following
Worksheets("Sheet2").Select
Workbooks.Add
Windows("FT Bi Test.xls").Activate
I need something more like this (though this exact code doesn't work):
Worksheets("Sheet2").Select
Workbooks.Add
Windows("FT " & Range("A7").Value ".xls").Activate
Or something like this:
Worksheets("Sheet2").Select
Workbooks.Add
Windows("FT " & Variable ".xls").Activate
View 6 Replies
View Related
Jun 19, 2008
I have only the basic knowledge of the VBA programming. Are there any books you can recommend?
View 2 Replies
View Related
Aug 21, 2009
how to get excel to open a work book in my c drive if i have given it the location in cell m2
eg: the cell is M2
C:AVERAGE PRICE (update 2009) 240809
i need the macro to open this workbook when i click the button in the workbook i have open that has the above in cell M2
View 3 Replies
View Related
Sep 25, 2009
I have a workbook with two worksheets. I have an "E-Mail" button within the workbook that, when clicked, emails the entire workbook (using Outlook). The button essentially triggers a macro that makes a copy of the file, opens the dupilcate, mails it, then deletes the duplicate ... all the while the original is still open and not changed at all.
Everything works fine, however I would like to know if there's a way to have the "E-mail" button to just email one of the worksheets. For example, I have two worksheets entitled "WFS" and "CAR". When the email button is clicked, I would like to only have the "CAR" sheet emailed. Here's the code I currently have in place:
View 2 Replies
View Related
Jan 8, 2010
I have a workbook that contains two worksheets. The columns are the same between the two, column A is the Employee ID in both worksheets. The other column headings are: Name, address1, address2, city, state, zip, EmgerName, EmgerType, Cell, Address1, Address2, City, State, Zip.
What I'm looking to do is compare WS1 with WS2 and in WS2, what ever is different from WS1, the font color changes to RED. For example let say for employee number 1234, everything is the same expect for EmgerName and Cell, then these fonts are changed to RED in WS2 so I can identify them quickly.
View 8 Replies
View Related
Jan 14, 2010
Hi everybody, I'm doing my first excel application program and everything is going good,
but I have one problem.
I want to click on a command button in one workbook that is supposed to lead me to a specific sheet in another workbook and to close the first workbook.
I used the following ....
View 9 Replies
View Related
Aug 5, 2009
This is the error i get by doing> edit> move or copy sheet
A formula or sheet you want to move or copy contains the name 'HTML', which already exists on the detination worksheet. Do you want to use this version of the name?
I want to do is copy a sheet into the same book. If I click yes, two more errors pop up.
View 7 Replies
View Related
Mar 19, 2005
got work book that has about 20 sheets in it.....there are links throught the workbook. ......one sheet in particular when i go to it, it freezes up...and i get the dreaded "Send Error Report to Microsoft" window"...and we all know what happens next.....excel shuts right down.
I can open the workbook and click on ANY sheet....but when i click on this one particular sheet in the book i get the error message
This work book is a template....its the estimating work book i use at work...and whenever i get a new job to estimate i open up this template.....put in my data and save the workbook as the job title.....so basically i have about 50 of these workbooks......and it doenst matter which one i open.......whenever i go to this one same sheet in any workbook i get the freeze
and the freaky thing about this is it does it randomly....I make save this template (as a new work book) when i get a new job to estimate.....and i never have any problems.......but today for some crazy reason its doing what i mentioned above......it did this about a month ago too.......same exact problem.
when it happened the first time i tried all kinds of stuff, and the only thing that worked was i had to go to windows explore...save all the files to a memory chip.......go to a different pc with my version of windows (XP)....open each file up......re-save it.......go back to my pc...reload it
View 9 Replies
View Related
Dec 14, 2006
I have designed a spreadsheet that updates automatically and shows the company's perfomance on several sheets.
To add to the use of the sheet I would like to offer the user a preference set up. So they choose the sheet it opens on for example.
I am happy with how to do all the above except for the fact that the sheet is required to be available to all staff! so only one employee can have it open in read/write everyone else will eb read only!
I was thinking the only way around this would be to have a second sheet that saves their environ user name and preferences.
That would require using the sheet closed though would it not?
View 9 Replies
View Related