Macro On Shared Workbooks
Mar 1, 2007
I've set up a macro to run in the workbook open event, to open a user form that restricts user access to the spreadsheet. This works fine, but I need to make the spreadsheet shared and when I open it the macro doesn't run. it's still possible to use the workbook_open event on shared workbooks or if not suggest an alternative method of running the macro on opening.
View 2 Replies
ADVERTISEMENT
Mar 16, 2009
I have a shared worksheet my self and a few others key pricing into weekly, more or less a price check for stores we service. I have created another workbook that has the same basic template with links to the "shared" worksheet. In this workbook Im trying to run a macro to copy the pricing "template" into a new tab in the workbook. I keep getting this error as it pertains to "sheet". I would like the tab that is created to be named whatever the current day is if possible.
Sub StoreWeeklyData()
'
' StoreWeeklyData Macro
' Macro recorded 3/16/2009 by : Creates a tab for current week pricing data.
'
' Keyboard Shortcut: Ctrl+s
'
Sheets("Template-Link").Select
Range("A1:AM61").Select
Selection.Copy
Sheets("Template-Link").Select
Sheets.Add
Sheets("sheet").Select
View 9 Replies
View Related
Jan 12, 2009
have had to try to automate a function which will transfer all rows of data that an operator "checks" in a check box, to a seperate sheet before printing. Written under pressure with boss at my elbow so I will tidy later.
My problem is that there is a command within the macro (after the filtered data is copied over to Priority sheet) which will not allow the macro to fully execute when the file is shared.
Copy file attached.
View 10 Replies
View Related
Sep 25, 2007
I have a workbook which I need to give shared access.
The workbook has macros which make sheets visible and VeryHidden and also give certain sheets protection. Also a filter runs on one sheet.
When I give the workbook shared access, the macros error?
how I can give me workbook shared access but still allow the macros to hide/unhide sheets, filter and protect worksheets?
View 4 Replies
View Related
Nov 11, 2009
Ive got a problem with a work book im working on at the moment, my company has various different documents created in excel, like a price list, cost price list & stock levels (all Independant) I have had the idea to join them all into a single shared workbook using an idea I found and modified over a year ago on this site, that had the promise of allowing multiple users to see the nessesary parts of the same document. the advantage of this being any new parts or prices or suppliers added would update all users at once. So ive got this workbook that when you open you get asked for a username & password this then hides/unhides, protects or unprotects to suit the users needs. This works great when unshared but when I share it the login box wont display
The Administrator username is jamie and the password is joshua
View 10 Replies
View Related
Sep 13, 2007
I have a shared workbook where 5-6 people could be updating the log sheet at any one time. The problem is a I have a macro that I would like to run to update ( cut n paste to different sheets, etc) that doesnt like running when the workbook is shared. What I currently do is have a button that when clicked - changes the document to exclusive, runs the macro, then changes back to shared. I was hoping I could run the macro on an worksheet event? But i'd like it to run only once - Possibly when its first opened for the day by anyone of the users.
View 4 Replies
View Related
Aug 18, 2014
Any way to bypass the unprotect sheet in a shared work book, this is what i came up with so far
[Code] .....
View 4 Replies
View Related
Aug 30, 2006
I am encountering a specific scenerio where In I am creating a New file by copying one of the sheets And renaming that With todays date. here starts me problem when I try To share the sheet To work around I am seeing that th macro Is Not copying the sheet properly even though i have given PasteSpecial. The code goes here
VB: AutoLinked keywords will cause extra spaces before keywords. Extra spacing Is Not transferred when copy/pasting, but Is If the keyword uses "quotes".
Sub Newsheet()
sheetname = Format(Now, "dd-mmm-yyyy")
MsgBox sheetname
sheet_count = Worksheets.Count
'Checking for Replication................
View 9 Replies
View Related
May 28, 2008
I've been having trouble recently with my workbook file size growing rapidly due to copy and paste commands and such. I found a very nice macro to reduce file size called ExcelDiet located at [url]
Option Explicit
Sub ExcelDiet()
Dim j As Long
Dim k As Long
Dim LastRow As Long
Dim LastCol As Long
Dim ColFormula As Range
Dim RowFormula As Range
Dim ColValue As Range
Dim RowValue As Range
Dim Shp As Shape
Dim ws As Worksheet
Application. ScreenUpdating = False
Application.DisplayAlerts = False
On Error Resume Next
This code works fine until I share the workbook. Can anyone take a look at this code and provide some information as to why this might be happening?
View 6 Replies
View Related
Dec 30, 2008
I have an addin in a shared folder which was created by someone else. (it is a user form). I need to create a macro which will go to its existing folder and then save it in the users personal addin folder also picking up their user id. There will be about 100 users so easier this way than going round doing it for them.
So I suppose the query is three fold.
1, pick up the addin and save it in a personal addin folder.
2, Find the username as part of the path file. For instance my personal would be:
"C:Documents and SettingsO033116Application DataMicrosoftAddIns"
The "O033116" is where I will need a search completed to obtain the user id.
The addin is called ServiceCredt.xla
3, Activate the installed addin.
The reason I want it this way is so the user is unable to access any of the code and we are in control.
View 8 Replies
View Related
Apr 25, 2007
i need to make a macro that takes workbooks or files and
runs them through another macro. i already have the 2nd macro
done and it is working perfectly i just need to know how to make the one
that finds the other files and runs them all through the macro i already made. My boss said that he will have about 150-200 files to run through this macro.
View 9 Replies
View Related
Nov 30, 2007
I would like to create a module for spreadsheet and I want it to be included in all excel files, i.e. whenever you open any excel file that vba module should be included
View 4 Replies
View Related
Jan 28, 2014
Below is a code which I added to my 'Quick access toolbar' (and which is based off a hidden workbook). I use this macro to fulfill tasks to regular excel spreadsheets that are not macro enabled, however, I can't seem to get this macro to work for other workbooks. How to modify my code to work for other spreadsheets.
[Code] .....
View 4 Replies
View Related
Mar 25, 2014
I have 7 different workbooks as part of my daily routine.
At present the first workbook is opened via the task scheduler, and the macro is run using the following code
[Code] .....
This then opens the next workbook and closes the current one. The next workbook then runs its macro again from a timed call
[Code] ...........
This repeats for 7 workbooks. The problem is, if a macro overruns - the whole schedule is out of sync when macro's are called depending on the time. What I would like to do, is link each macro by calling for the next one, and closing the current workbook. However, when i have tried to do this, the macro has always stopped when the workbook has been closed - the next macro doesn't run.
View 2 Replies
View Related
Nov 13, 2013
I need to create a macro that pull in data from various spreadsheets, all with the same layouts, but with different file names and different worksheet names, into on master worksheet. The data should drop in after the title line and then continue on after each data set has copied.
View 3 Replies
View Related
Apr 17, 2007
I need to remove hyperlinks across probably 30-40 workbooks, is there a way of doing creating a macro that would do this across many instead of 1 at a time?
View 9 Replies
View Related
Aug 10, 2008
Could somebody update the below code so that it actions all open workbooks except the master (Book2). Also, so that it appends the data (which is basically 2 neighbouring colums of data) to the Master starting in column A
Sub Format_RAW()
'
' Format_RAW Macro
'
' Keyboard Shortcut: Ctrl+s
'
Selection.AutoFilter
ActiveSheet.Range("$A$1:$P$5105").AutoFilter Field:=7, Criteria1:=Array( _
"H1", "H2", "H3", "H4"), Operator:=xlFilterValues
ActiveSheet.Range("$A$1:$P$5105").AutoFilter Field:=1, Criteria1:= _
"Tu"
Range("G7:H7").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("Book2").Activate
ActiveSheet.Paste
End Sub
View 9 Replies
View Related
Sep 25, 2008
I have a macro that I use to keep other worksheets updated with current codes and whatnot. The macro opens each workbook in the directory and updates the worksheets. It works fine except that it's only updating 1 sheet within the workbook (whatever sheet is active). I need help actually cycling through ALL the sheets in the workbook. There are 7 worksheets in each workbook. The code I need help with is in red.
'=====================================================
'CODE BELOW IS USED TO UPDATE INSTRUCTIONS SHEETS.
'=====================================================
Dim FromBook As String
Dim ToBook As String
Dim ToSheet As Worksheet
Dim SPDir As String
Sub Update_Columns()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.Calculation = xlCalculationManual
SPDir = "m:SPDWA"
FromBook = ActiveWorkbook.Name
'-Code to loop through files in directory.
'On Error Resume Next
ToBook = Dir(SPDir & "*.xls")
While ToBook ""
If ToBook FromBook Then
Application.StatusBar = ToBook
Update_Data ' subroutine below
End If
ToBook = Dir
Wend
'-- close
Range("A1").Select
MsgBox ("Sheets Updated.")
Application.StatusBar = False
Application.Calculation = xlCalculationAutomatic
End Sub
'=====================================================
'SUBROUTINE TO LOOP THROUGH FILES AND COPY CODES.
'=====================================================
Private Sub Update_Data()
Workbooks.Open (SPDir & ToBook)
For Each ToSheet In Workbooks(ToBook).Worksheets
ActiveSheet.Unprotect "Password"
Update_Column_Fields 'Subroutine to copy codes (not shown here)
ActiveSheet.Protect "Password"
Next
Workbooks(ToBook).Close savechanges:=True
End Sub
View 9 Replies
View Related
Oct 2, 2009
Rather than just export and import a module, to import a sheet macro?
I don't quite know what they're called, but basically I have a functional Worksheet_change macro, which is sitting idly in a module. When a separate macro is run which creates new workbooks, It exports that specific module to the desktop, and then the new workbooks all import the module. THat works fine.
But I want all of the new workbooks to get a worksheet_change macro (so a macro that goes into the sheet, not into a module in the workbook)
View 9 Replies
View Related
May 7, 2007
I was able to create a macro that formats the worksheet that I am working on. However, I would like this macro to be available to all worksheets that I would be downloading from a system.
I tried using the personal macro workbook, but when I ran the macro, it formats the personal worksheet and not the one that I would want to format.
I used general codes, but it pasted the formulas onto the personal.xls file.
View 4 Replies
View Related
Sep 5, 2007
Ive just started using vba for excel and put together a very simple peice that uses the goalseek function. See below.
Public Sub calc_vol()
Dim currentcell As Range
Worksheets("sheet1").Activate
Set currentcell = Worksheets("sheet1").Range("bl2")
Do While Not IsEmpty(currentcell)
With Application
. Iteration = True
.MaxIterations = 100
.MaxChange = 0.00000001
Application. ScreenUpdating = False
Application.Calculation = xlCalculationManual
End With
ActiveWorkbook.PrecisionAsDisplayed = False
currentcell.GoalSeek 0, currentcell.Offset(0, -13)
Set currentcell = currentcell.Offset(1, 0)
Loop
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
The code works great (a little slow - but fine for 65,000 lines), however i have nearly 100 workbooks that i have to run this macro for. I was wondering if anyone knew how i could manipulate it so that i could incorporate all 100 files into the macro, therefore running the macro once for all 100 files. If this is not possible is it possible to link multiple worksheets.
View 2 Replies
View Related
Mar 13, 2013
What I'm trying to achieve.I'm trying to create a toolbar to have visible in excel which provides me with shortcuts to a selection of functions and some other useful documents.
I've created a document "Toobar 1.xls" in column B of which I have the file locations of the documents I want to open, the documents are moved from time to time and it is easier for other users to update the spreadsheet than vb.As you can see below I've written a piece of code to open up a document, I've created a function because there are a few documents I want to create links to and thought it would be cleaner to do it like this. This code is stored in "Module1" of "Toolbar 1.xls".
I've then created a new toolbar in excel and added a custom menu item and allocated it the macro "Pension_Credit_Calc".
When I run the code from within "Toolbar1.xls" it works fine, however if I try to run it from another workbook I get "run time error 1004". I suspect it's probably something to do with where I've stored my code,
PS. The reason I have not simply created a shortcut in the quicklaunch bar is that I will also be altering the workbooks once opened.
Code.
VB:
Function OpenUp(FileLocation) As String
Workbooks.Open (FileLocation)
End Function [code]....
View 2 Replies
View Related
Mar 29, 2013
I am trying to cycle ALL open workbooks so that I can choose the file to manipulate in subsequent code this is the code that I am utilizing furhter below
this is my code
VB:
For Each wb In Workbooks
If MsgBox("Do you want to do access this Workbook for the Update " & Chr(10) & Chr(10) & wb.Name, vbYesNo) = vbYes Then
wb.Activate
VI_wb = wb.Name
I = True
End If
Next wb
But for some reason it only loops through .xls and xlm workbooks BUT not .xlsx
is there a way that I can loop through any and all open workbooks.
The reason I do this is because my update are based on many numerous excel workbooks with differnet extentions, and naming conventions and many of the come via email, I cannot use the eact naming convention
View 1 Replies
View Related
Jan 24, 2014
I'd like to create a macro that will take 10 workbooks and add them to a new work book, but have each workbook as a separate sheet.
So every month from work I get a report file labeled as the current month (JAN_14). Then there about 19 folders in that folders labeled with product names; then in those folders are two excel files (they're all named MSTASCH_QUICKLOOK_1 and MSTASCH_QUICKLOOK). I figure if I can see the macro to combine 10 workbooks I can change it to do less or more workbooks. I had tried a macro that takes the workbooks from one file and puts them into two seperate sheets (although I would love to have the order changed of how they're put into the workbook).
VB:
Sub MergeSheets()
Dim wbDst As Workbook
Dim wbSrc As Workbook
[Code]....
View 4 Replies
View Related
Apr 7, 2014
I have approximately 30 workbooks for which i open and run a macro to change the look and feel for client perusal.
I normally open each of the 30 workbooks and run the macro for each one.
Is there a way I can run the macro to apply to all workbooks at once?
View 3 Replies
View Related
Mar 12, 2014
I have a macro to get copy of sheet named "Doc Info" from workbook File 1 to active workbook.
I could do it for one file on any active workbook.
But what I would require is, upon executing this macro , i want this macro to get executed in all open workbooks( could be any numbers ).
I want to move copy of sheet from File 1 to all open workbooks ( which i am doing it manualy for every file )
All these open workbooks could be from any folder , wont be in same folder.
So logic is to execute my macro apply in all open workbooks in my computer.
Below is the code and i have attached file for test
HTML Code:
Sub Copysheet()
Dim wSht As Worksheet
Dim wBk As Workbook
Dim wBk1 As Workbook
Set wBk = ActiveWorkbook 'Workbooks("File 2.xls")
Set wBk1 = Workbooks("File 1.xlsm")
Set wSht = wBk1.Sheets("Doc Info")
wSht.Copy before:=wBk.Sheets(1)
End Sub
View 2 Replies
View Related
Feb 8, 2007
I have 100's of workbooks that have a mispelled word in a cell. Some of the workbooks have more than one sheet. I have written a macro that will correct the mispelling, and now would like to have the macro run automatically everytime I open a workbook, I would like for it to check all the sheets, but if not, then whatever sheet the workbook opens to will be fine. Here is the macro.
Sub mySpelling()
Dim myWord
Range("b22").Select
myWord = ActiveCell
If myWord = "Quanity" Then
ActiveCell.FormulaR1C1 = "Quantity"
End If
End Sub
I have done a search and have seen about "personal.xls", that does not seem to work. Thinking that I will have to add something to XLStart folder but not sure.
View 3 Replies
View Related
Oct 15, 2008
the code necessary to merge all open workbooks (each contains only one worksheet) into 1 workbook made up of all of these individual worksheets?
View 2 Replies
View Related
Mar 28, 2009
I am looking for a way to close a group on Workbooks that are in separate instances of Excel.
These Workbooks get opened similar to running a Powerpoint program, but much different usage than Powerpoint.
AS AN EXAMPLE:
I have 7 Workbooks open in Excel . . . Could be more or less.
Each workbook has 2 sheets, the "User Sheet" (not the actual name, as all user sheet names vary) and a sheet named "Setup." (Always named "Setup.")
On the "Setup" sheet I have a list of all the possible Workbooks that I want to close. For reference purposes only, I'll call this list "To Close". All 7 Workbooks would be listed, but not all of them would be opened. If any particular Workbook on the "To Close" list is not open, it would simply be bypassed.
Example of list: Column A
Row 25 has the name of Workbook A
Row 26 has the name of Workbook B
Row 27 has the name of Workbook C
And this would continue down to the last Workbook possibly open. I will know how many Workbooks could possibly be open.
Other workbooks could also be open, but they would not be closed by this macro. In this example, I would only want Workbooks A & B & C closed.
I would have rows 25 thru 27 (or more) listed in the same location on the "Setup" sheet of each Workbook.
Each "User Sheet" would have a macro called "Close Group"
The macro would have to search through all open Workbooks and when it found one of the Workbooks listed for closing, it would close that workbook. Then, the macro would look for the next Workbook on the "To Close" list.
The Active Workbook would also be on the list and that also needs to be closed. I would guess that this would be the last Workbook to close, but it really would not make any difference if the macro would still work. I think the macro has to have the active Workbook open to close the others.
After the list has been gone through, the macro would stop.
NOTE: Each Workbook has it's own "To Close" list. If it would help, I can leave the Workbook Name A off of the list in Workbook A. I would do the same on Workbook B, etc. Then the Active Workbook could automatically be closed at the end of the macro.
View 14 Replies
View Related
Apr 14, 2009
i have this macro to save as a csv this macro only save the workbook the you are looking at, i will like for this macro to save as a csv all open workbooks preserving the name of the xls file.
Sub SAVE_AS_CSV()
Dim strFilename As String
strFilename = ActiveWorkbook.Name
strFilename = Left(strFilename, InStr(strFilename, ".")) & "csv"
ActiveWorkbook.SaveAs filename:=strFilename, FileFormat:=xlCSV
End Sub
View 2 Replies
View Related