Intention is to (automatically) fully protect each completed worksheet/workbook on "save"/"save as" in MS Excel 2007... Is this possible by means of a macro? Which one? Saving in a ".xlsm" format is required?
I have an expense report, which was originally done in Excel 2003. It still prompts users to open as read only however if they select no, they are not prompted for the password, and it has allowed them to save, so when the next person opens it, they have the previous person's report instead of the clean workbook. I have tried everything to put a password onto it. I know this is really basic stuff, but maybe I am missing a step? I want the end user to be able to make all the changes they want in read only mode and then do a save as, but if the select No when prompted "Open as Read-only?" they should have to put a password in.
am using Excel 2010 and having issues trying to save a worksheet to a specified file location with the save date....
I have tried several posts form this forum and elsewhere and can't seem to get the macro to do what I want.....
I want to save a 'worksheet' from an open workbook that I use for updating information to the same file path as the workbook with the date the file saved...
I have a sheet full of data.All this long I had written the code to save the selected cells as a PDF.But now I want it to be saved as a separate file. In this case, I believe, first the VBA will have to open a new workbook. Then copy paste this sheet onto one of the sheets in the workbook . then save the .XLM file.
I have a save button on a user form that saves a workbook
Private Sub SaveBookbtn_Click() ' SaveAs using data from workbook cells Dim ThisFile As String Dim TheFilename As String
ThisFile = Sheets("Sheet1").Range("A2").Value TheFilename = Application.GetSaveAsFilename _ (ThisFile, filefilter:="Excel Files, *.xls") If TheFilename = "False" Then Exit Sub ThisWorkbook.SaveAs TheFilename ThisWorkbook.Close End Sub
But what I would like to do is save just "sheet1", and not the whole workbook, using ThisFile as the name to save it under - where I can choose which directory it can go in. I have tried to modify the code to get the desired results but I can't seem to crack it. Can the above code be modified to do the job or am I going to have to start from scratch?
How to copy the entire worksheet into a new workbook and save the file to a specific directory with the following filename format ("exceptions191011 - ie. the word exceptions followed by today's date in ddmmyy format).
How to add the following condition that if a file already exists with that name then to bring up an error message stating the file already exists? As well as save the new workbook, it appears to close the original workbook - can I stop this?
I have a workbook with a worksheet named "Report"... this sheet and it's macros generate a report from data on another sheet. I'm adding a button to copy the (filled) Report sheet to a new workbook, rename the new sheet in the new workbook "Rep[Name]", then save and close the new workbook. I've recorded a maco of me doing these tasks manually, but what's recorded seems very generic, and does not seem to specify what's really occurring...
For example (in part); > Rightclick on the Report tab > Move or Copy > To Book: (new book) > [x]Create a Copy > [OK]
yields:
Sub Macro1() Sheets("Report").Select Sheets("Report").Copy End Sub
This recorded macro does not specify (new book), or Before:"Sheet1" as was the result of my actions... and when replayed back, only makes a copy in the active workbook, before the active sheet...
I have a file consisting of many sheets. I need a macro that saves the file as a normal excel file, that is just a normal save as function. This I have. But then I also want the macro to save one of the sheets as a .txt file. This is what I got from reading this outstanding forum. But this saves all my sheets as seperate .txt files
Sub wsToText() Dim ws As Worksheet Application. ScreenUpdating = False Application.DisplayAlerts = False For Each ws In ThisWorkbook.Worksheets Sheets(ws. Name).Select Sheets(ws.Name).Copy ActiveWorkbook.SaveAs Filename:= _ "C:Documents and Settings1kitvelDesktop" & ws.Name & ".txt", _ FileFormat:=xlText, CreateBackup:=False ActiveWorkbook.Close ThisWorkbook.Activate Next End Sub
have seen macros that create a seperate sheet & save by tab number etc, & wonder if its possible to save each sheet in a workbook as the value defined in each sheets cell A2. is there a vb macro available to do that ? if so where ?
I have the below macro steps to save an excel sheet in PDF format in "C:UsersxxxxxDesktop" and with the name of the workbook.
But when the PDF report gets published in c: drive , the PDF file name has .xlsm added to it instead of just the file name. I would like to know how to publish the file in PDF format just in the name of the workbook.
Find the below macro steps:
Sub Docsave() Dim docname As String docname = ThisWorkbook.Name ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="C:UsersxxxxxDesktop" & docname, Quality:=xlQualityStandard, _ IncludeDocProperties:=False, IgnorePrintAreas:=False, OpenAfterPublish:= _ True End Sub
Windows 8.1 Excel 2010, I open a Template, make some changes in the template then I want to save the modified template as a Template ".xltm" under a new name. I'm using the following code for the new workbook name (which works except for the file extension);
I am using 2007. This may be something simple but I can't seem to find a solution to this, I have an excel macro enabled workbook which produces a daily report the final task is to save and send an email but I need the file to save as an xls rather than xlsx as some of the recipients are unable to open the file here is the code used for the tasks in the
workbook:Sub Step1_Refresh() ' ' Step1_Refresh Macro ' ' ActiveWorkbook.RefreshAll End Sub Sub step2_save_close()
I am using 2007, I have an excel macro enabled workbook which produces a daily report the final task is to save and send an email but I need the file to save as an xls rather than xlsx as some of the recipients are unable to open the file.
I have a macro that opens all workbooks from one directory and runs a macro for each workbook to clean up the data. I cannot figure out how to take all those open workbooks and save them to another directory and close the workbook. Also, I do not want the macro workbook (xlsm) to save. I only want it to close. I am working in 2007 Excel.
Automating Excel from Access, I'm attempting to generate a single sheet workbook and save to a Sharepoint site. This process works fine on my machine (XL2007, XP), but on a coworkers computer (XL2003, XP), the code throws a 1004 error on the save as line. However, the really odd thing is that stepping through the code doesn't throw an error on the coworkers machine.
Here's the sub being ran; the line it errors out on is the first branch in the .saveas block.
Private Sub PublishXLtoMOSS() Dim objXL As Excel.Application 'Object Dim wb As Excel.workbook 'Object Dim ws As Excel.Worksheet 'Object Dim rs As DAO.Recordset Dim i As Long
I'm a fan of the Excel 2010 table styles, but can't figure one thing out. When I create a table in excel (Ctrl+T), I like to reformat it with a new defined style. When I save the style, I can use it while I'm in that instance of excel, but when I close and reopen excel, the style is gone. How to save the custom formats to they are always available?
I have figured out how to save the workbook using a variable to saveas but I would like to create a new folder to place the new workbook into. I have tried a few things a am not having any luck. I recorded a macro and the code it produced is as follows.
I have a table that lists names, eligibility and # of people. That is just one worksheet. I have a total of 30 worksheets in that workbook. The column with the names is completely filled out. I entered a number in the eligibility and # of people columns and Excel copied all three cells (name, eligibility and # of people) to the same cells on all of the worksheets. I have no formula in any of the cells, nor do I have anything linked.
Ok I am using Excel 2007. I want to copy 4 cells from a row on sheet 1 to sheet 2 based on value in first cell in row. Example if cell a13 > 0 then copy row 13, cells b13 thru e13 only to first available row in sheet two but starting from row 12 on sheet two. Because sheet 2 has title information at the top from row 1-12.
I would rather not have to use a button to do it, would like it to do it as data is entered in sheet 1.
I've added some code the adds a button to a worksheet
Public Sub AddSheetPrintButton() Dim btn As Button Dim t As Range Set t = ActiveSheet.Range(Cells(1, 6), Cells(1, 7)) ' button position Set btn = ActiveSheet.Buttons.Add(t.Left, t.Top, t.Width, t.Height) With btn .OnAction = "sheetPrint" .Caption = "Print Sheet" .Name = "Print" .Font.ColorIndex = 10 End With End Sub
I am trying to add the sheet name to the center footer for each worksheet in a workbook. The workbook has about 80 sheets and it is cumbersome to do this manually. I am using Excel 2010.
I have tried to record a macro capturing what I do manually, but when I run the macro on another sheet, it does not add the sheet name to the center footer.
I have tried searching for a macro online and the ones I have found just crash excel.
I know I am probably missing something obvious in my macro code.
I'm trying to build a workbook (2007) with multiple worksheets where each worksheet corresponds to a different query/dataset pulling data from the one database.
I would have expected that you could define the one data connection object and then specify the SQL that each worksheet table will invoke. The apparent structure of having the query coupled to the connection object is confounding me. I'm therefore trying to set up a separate connection for each of the worksheets and Excel is getting tied up in knots.
I'm trying to create a macro that will look at each worksheet in a workbook and then delete the last line of data on each worksheet. The last row can vary on each worksheet. This is what I have come up with but it is not working. I am on Excel 2010 and Windows 7.
What I am trying to do is that I have an excel file with macros and it is a read-only file. In order for the user to save, I want them to only be able to save as a .xlsx file as it disables all macros. If for whatever reason, the user wants to save the file as another .xlsm file, they should be allowed but before they save, a "are you sure you want to save as .xlsm?" message should pop up.
All the options in the save as box should still be available in case they want to save in that particular format. Just that the .xlsx should be the default.
I'm using some workbook-scoped named formulas to define some dynamic ranges which will be referred to by numerous worksheets. The named ranges are defined like:
NAME: gTable_costDetailsEquipment REFERS TO: =globalParameters!$B$5:INDEX(globalParameters!$B$5:$C$1048576,1+countAdjacentNonBlank (globalParameters!$B$5,"down"),1+countAdjacentNonBlank(globalParameters!$B$5,"right"))
From either of the tabs "Reports" or "DOR_Template" the user can press the large "+" icon to add a report (which copies the template or the last report to a new sheet).
When this Sheet copy takes place, excel is repeating my named formulas - this time it's making LOCAL versions scoped to the newly made worksheet.
I've used this copy sheet trick before and have never had excel create new, locally scoped, named formula for each workbook level name.
I also just recently started using excel 2013, is this a problem with the new version? I've just never seen this problem, usually workbook-level names are NOT duplicated on sheet copy.