I'm building my first Add-In, which I'm using to gather all Sub's that I've created through my small VBA writting career. The thing is that when I write new code and some reason exit Excel and forget to save the XLA, obviously the code is lost. I've used:
I'm trying to make a macro check if a file has been saved (ever). If so I want the macro to do a regular save (with already esatablished filename and location) before it proceeds with the rest of the macro. If the file hasnt been saved (if it runs from a new workbook) then I want it to pop up the save.as dialog, so that the user can choose the name and location of the file before the macro continues .
I would like to add some icons on the left side of excel open file pane to faciliate my work. Because i need to load some files under the same folder many times a day. Does anybody know how to do that? I've seen people has more icons on the pane before. The defaut setting has only 'History', 'My Documents', 'Favorites', 'Desktop' and ' My nutwork places' on it.
How can i call the Save As dialog box from a macro, and pre-populate the filename field with a cell value from the workbook? I have tried this code
With Application.Dialogs(xlDialogFileSaveAs) .Name = Sheets("Calcs").Range("b37").Value .Show End With
with the cell reference being what i want to show in the filename box. Each time i run it, i get an error message, "run time error 1004, application defind or object defined error"
When a user tries to save a workbook I want the workbook to display the Save As dialog box. This will ensure that the template is not accidentally tempered with.
I want to be able to have the Save As dialog box come up, but with a File Name already chosen, so that the user can save it as this File Name in any location he/she wishes. I can get the Save As dialog box coming up with my code, but I don't know how to automatically enter the File Name
I am modifying a corporate macro that is used in to create a standard technical letter. This standard file has 6 macros, that once used to create the letter, are never used again. I know, the first thing that jumps out is to create an add-in. I'd prefer not to got hat route at the moment for various reasons.
What I'm looking to do is after the letter is created, and the print macro is called and prints the letter, all macros are removed (already found help for this on this site), then check to see if the file has been saved, or still has the template name, and then either save or bring up the save as dialog box for the user to save the file with the appropriate name and folder.
I am running a macro on startup from a template that opens the File Save As dialog box to allow the user to select a folder and filename and save it before continuing.
I would like it to default to the Q: drive, it defaults to where the template was opened from.
I used
Application.Dialogs(xlDialogSaveAs).Show
to open the dialog, I tried using "Q:" as an argument but it doesn't seem to work. if I try
I have a command button code on a sheet that checks if all the cells in a table have been completed before saving the worksheet. If they're not all complete a userform message box pops up with a reminder then returns to the sheet without saving. I want to be able to call this from the 'BeforeClose' event as well however, even though it still does what it's supposed to do, after the userform message box has displayed and been unloaded then it still pops up the Save Dialog box.
I'm struggling to suppress the Save Dialog box and return to the sheet.
I have the below code to have the user select a pile path and save. what can I add to have the dialog box preselect the file type to macro enabled? the .xlsm extension is not doing it.
['save it under a new name
Dim fPth As Object Set fPth = Application.FileDialog(msoFileDialogSaveAs) With fPth .InitialFileName = Worksheets("Project Setup").Range("f19").Text & "_ROM Estimate.xlsm" .Title = "Save your File:" .InitialView = msoFileDialogViewList .Show End With]
I have a summary file (I'll call it File A) from which a macro is run. It opens other files, finds a "total line" then copies it into File A. Then it closes that file, opens another, and repeats the process. The macro works fine for most of the files it opens and closes, but on some of them, upon the close command, a dialog box pops up asking "Do you want to save the changes you made to "File B.xls"?
I'm not sure why this comes up as there were no changes made. Cells were only copied and pasted into another file. Is there a way to stop this annoying box from popping up? It slows down the macro by waiting for human input. here is my
I currently have the following code that copies a range opens notepad pastes the range opens save dialog and types the file name. The problem I have is with overwriting the existing file.
I have some code in a standard module. When I try to run it, it does not appear in the dialog box. The code's below.
Code: Sub CopyCat(ByVal Target As Excel.Range) If Target.Column 21 Then Exit Sub If Target.Value = "Y" Then Cells(Target.Row, "A").Copy Destination:=Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1) Cells(Target.Row, "B").Copy Destination:=Sheets("Sheet2").Range("B" & Rows.Count).End(xlUp).Offset(1) Cells(Target.Row, "C").Copy Destination:=Sheets("Sheet2").Range("C" & Rows.Count).End(xlUp).Offset(1) Cells(Target.Row, "D").Copy Destination:=Sheets("Sheet2").Range("D" & Rows.Count).End(xlUp).Offset(1) Cells(Target.Row, "E").Copy Destination:=Sheets("Sheet2").Range("E" & Rows.Count).End(xlUp).Offset(1) End If End Sub
ive created a spreedsheet for work calculating money etc from different tills. is there a way i can have a box appear when the spreadsheet is opened asking for particular information to be entered.
I have created a worksheet with Excel Dialog worksheet. I have Edit Boxes and have input data into them. Is it possible to add these data and put the result in another Edit Box,
I've written a function macro that results in a dialog box popping up as in ....Application.Run "showsampdat"
What is the general Syntax for adding a macro line that will enact the OK Button on the Dialog box so that the user will never see the dialog box but the OK button functions?
I have created a dialog box for entering data into once that data has been entered i want the dialog box to store the data into a separate worksheet at A2 in then want the dialog box to clear and reappear ready for new data to be entered. This new data would then need to be entered at A3 etc etc etc. Is this possible and how would i go about doing this.
I am very sure that I have deleted all my macro in my excel spreadsheet and saved. However, when I tried to open the file, the macro dialog prompt me again..... I have press alt F11 and confirmed that there is no macro.
I'm modifying a template that originally shipped with Excel 2003 (I have not upgraded to 2007). In the template, there is a pop-up box (not a dialog box) that shows up when I'm on certain cells. I've attached an image of it. It's the yellow box containing the words "Company Information..." etc. I cannot find any way to remove it! It's not a comment, and selecting it doesn't allow you to edit it. What is it, and does anyone know how to remove it?
I would like a macro to print 2 sheets in a workbook. I can write the macro that will select the sheets I want, but I don't want it to just go and print because depending on if the user wants it printed in color, b&w, etc.
they have to choose a different color. What code do I use to open the print dialog box?
Is there a dialog box like the one used in GetOpenFilename that can be used to select a directory?
I'm trying to select a directory/folder which will change each month but the macro selects the files from inside the folder once it's specified. I don't need the name of the current path; the path name needs to be able to be selected.
I'm hoping someone can stop me going crazy with what should be something very simple. To make things easier at the end of my code, all I'd like to do is bring up the SaveAs dialog box and have it default to a specific directory so that the user doesn't have to click through the mountain of various files and folders we have.
I attached a file with macro7 that prompts the user for text that will get rotated and inserted into the top left corner. The text is in the form "batch xxxx." I need a carriage return between the word "batch" and the numeric string. I guess the input box should have two lines instead of one.
the code does some other stuff which is why it takes a while to execute ....