SaveAs - Inputbox Data
May 31, 2006
I want to use the SaveAs function using the Inputbox results. The user will input a date like 5-30-06. Then I want save the workbook as "WE5-30-06.xls". I can't figure out how to do this b/c it wants to use 5/30/06 which isn't allwoed in naming conventions. BTW the inputbox name is dWeekend.
View 2 Replies
ADVERTISEMENT
Jun 30, 2009
I have the inputbox so i can set a string value,
When the inputbox Cancle button is pressed i want to exit sub,
If the inputbox value is nothink and ok button, I want the msgbox displayed then goto newname.
If the inputbox has a value do >>>>>>That>>>>>
View 6 Replies
View Related
Jun 7, 2009
I am running 2003, but I'm working on a WB from a colleague running 2007.
I have downloaded the converter from MS.
The document is a Template, which I open, load with data from a .csv file, then SaveAs.
My problem is, whenever I SaveAs, the resulting document is Read Only, and I don't want it to be.
View 9 Replies
View Related
Oct 2, 2008
I have a worksheet, attached, that is a supplier response to a purchase order. Column E contains the original qty ordered of each part number, Column H contains the original price. Now, I've created a quick macro, (in the workbook), that copies the original values to the confirmed values, and the formulas in columns G and J calculate the qty backordered, or flags the part as a price change.
After copying the original PO values to the confirmed values, the supplier would need to go in and make whatever changes are necessary. For example, we ordered 3 and they shipped 0 of a certain part, or the price has changed.
What I would like to do is create a macro that pops up an input box where the supplier enters the Keystone part number, (column A), then enters the new quantity or new price, and those items are automatically changed on the response form. I picture it in the form of 3 input boxes, in the first box the buyer enters a part number. A second box pops up asking if it's a qty change or price change. They would enter the value in a 3rd box, and that value would automatically be changed on the response.
View 5 Replies
View Related
May 16, 2008
I need to have an inputbox for users to enter multiple store numbers. What I need to do is actually filter out the store numbers that was entered into the inputbox
my code so far is:
'Inputbox to filter out new stores
Newstore = InputBox("Enter New Store Numbers seperated by a space", "Enter New Stores", "119 120")
x = Split(Newstore, " ")
For i = 0 To UBound(x)
Range("A1").CurrentRegion.AutoFilter Field:=2, Criteria1:=Array(x) _
, Operator:=xlFilterValues
Next i
View 9 Replies
View Related
Mar 25, 2014
I have found a base macro that has most of what I want the only problem is I need it to search column A by the data entered by the user in the inputbox and send out an email if it meets all the requirements. I also need it to be able to be able to do that search by only the first letter of the company name (example, only needing to put in A in the inputbox for Amber Inc.). If I remove the red text the macro works perfectly but just runs down the list on the spreadsheet.
Column A has company names, Column B has email address' and Column C has the company contacts first name.
[Code] .....
View 5 Replies
View Related
Aug 1, 2008
I am using an inputbox to get a range a data from the user.
View 10 Replies
View Related
Jul 18, 2009
Here is my delimma. I am using the standard InputBox for my users to input the number of errors found for each category in a record from a daily report. The problem I having is that every time the user types in data using the InputBox it overwrites the previous days numbers. I need to set up the InputBox code so that after the user has input the numbers for that day that the next time the InputBox is used it selects the next column to the right and continues to do this for each day.
View 4 Replies
View Related
Apr 9, 2009
Is there a way too get the SaveAs box come up with a marco? When you go too file and save, a box comes up and lets you choose where and what you save. I would like too have it come up with a command button if its possible.
View 3 Replies
View Related
Dec 31, 2007
Sub CrearCSV()
Application.DisplayAlerts = False
ActiveWorkbook.Sheets("Prueba").Activate
ActiveSheet.SaveAs Filename:= _
ThisWorkbook.Path & "Prueba.csv", _
FileFormat:=xlCSVWindows, CreateBackup:=False
Set CSVfile = ActiveWorkbook
CSVfile.Close savechanges:=1
End Sub
Sheet "Prueba" is Hidden
Other Sheet is visible
Why SaveAs stores only the visible Sheet?
How does stored hidden Sheets with WorkSheet.SaveAs?
View 9 Replies
View Related
Apr 29, 2009
I'm running a macro in a template and trying to save the results to a different folder.
I want the file name to be blank in the Saveas Text box of the UI also. Unfortunatley my code is bugging out & I can't work out why.
ActiveWorkbook.SaveAs Filename:="C:", FileFormat:=xlNormal _
, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
The save to path does change so I want to be able to change the save location.
View 9 Replies
View Related
Jan 14, 2010
It is supposed to bring up an input box, the date entered in input box becomes the date of file. The file is then Saved As. This all seems to work but when I try to open the newly saved file the sheet does not open. Is this a file type issue? Should it be .xls?
Code so Far
Dim InputDate As Variant
Dim FileType As String
Dim myFileName As String
Dim myFolder As String
FileType = ".xls"
myFileName = "Report"
myFolder = "Q:Sales FinanceAndyDUBLIN MACRO TEST"
View 9 Replies
View Related
Aug 6, 2005
An already existing file will be changed by my macro and at the end I want the user to save the file with a different name in a different directory with the option to change the filename or directory. Therefore I use the excel-standard-dialog "save as". But I want the dialog to start in another path as the path the original-file is stored in. But also I use the ChDrive and ChDir Parameters the dialog even starts in the original-file-path. I think this is standard for the dialog and I should maybe use a parameter in the show-arguement? The code is below.
Option Explicit
Sub SaveMyFile()
Dim xFileName, xAnswer
ChDrive "J"
ChDir "J:myfolder"
xFileName = "testme.xls"
xAnswer = Application.Dialogs(xlDialogSaveAs).Show(xFileName)
End Sub
View 5 Replies
View Related
Feb 4, 2009
By Code I am trying to SaveAs the present Workbook : Only in the same directory as the present Workbook- but with a different file name. The new file name would be :"the Filename of the Active Workbook" + " ("D9") of the Sheet("ADMIN")". This macro will only be run from the Sheet("Admin").
View 4 Replies
View Related
Oct 31, 2009
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.
View 6 Replies
View Related
Dec 15, 2007
I have a very strange error at present. I am saving a sheet as a file using VBA from within Excel and when I run the program from the environment of my flash drive it works without a problem but when I run the same code on my main PC it causes an error :
Run time error 1004
Method SaveAs error ... and it causes Excel to crash and then recover the file.
The code that causes this is shown below : ....
View 6 Replies
View Related
Feb 7, 2009
Hello Members, I been trying to save a workbook as the name that will be input into cell B2 and the folder from what is input into cell B6. Without any luck using different codes.
In cell B3 is typed an new name and cell B6 is a list of clients that can be choosen from a selection in a dropdown.
Example, If 250R was input into cell B3 and Honda was selected in cell B6. The new workbook would be placed into the Honda folder with the name 250R.xlsm
To Copy and Save a workbook upon closing the new workbook.
View 9 Replies
View Related
Sep 3, 2009
way for other staff to do the following...
Open an exiting protected spreadsheet,
SaveAs [newfilename]
Unprotect new sheet
Edit new sheet
Protect new sheet
Save it.
Hence we how have two protected sheets with different filenames and different contents.
Then, next time, the teacher will start again with the new spreadsheet file resulting in yet another version of the same data. etc etc.
View 9 Replies
View Related
Feb 3, 2014
I have the following code working well. I'd like the pdf to be saved to the users local machine before it emails it. The user must be able to choose the path. How can I do this?
[Code].........
View 3 Replies
View Related
Mar 11, 2014
I am trying to edit the code below to save in .xls instead of .xlsm. Also, I need to disable the compatibly checker.
[Code]....
View 1 Replies
View Related
Jan 9, 2010
I found that there is an issue with saving a workbook where there seems to be an issue between 2003 and 2007.
The code I used:
View 3 Replies
View Related
Nov 24, 2012
I am trying to use cell C6 in my control sheet
Which is this
C:UsersNeilWin7DBTradingETFfiles
And put as a string into SaveAs
wbNew.SaveAs Filename:=Worksheets("Control Sheet").Range("C6") & TickerIndex & "ProSharesNAVRatio" & ".txt", FileFormat:=xlTextWindows
View 3 Replies
View Related
Jun 16, 2014
I am trying to use the string (sPath), I previously define to preform a saveas function after the script runs.
Code:
Sub CombineSheets()
Dim sPath As String
Dim sFname As String
Dim wBk As Workbook
Dim wSht As Variant
Application.EnableEvents = False
Application.ScreenUpdating = False
[Code] .......
These reports are always located in a subfolder defined as "D:DropboxWorkVerification Reportslocation name" where location name is the name that I want to use to save the workbook.
So as an example an excel workbook report generated in the folder:
"D:DropboxWorkVerification Reports!Test"
Would be saved as "!AirCheck AutoTest Report - !Test.xls"
or a report in the folder:
"D:DropboxWorkVerification ReportsHoliday Inn Surfside"
would be saved as: "!AirCheck AutoTest Report -Holiday Inn Surfside.xls"
Right now the code I guessed on isn't working and its generating an error on compile "Can't assign to read-only property".
View 7 Replies
View Related
May 10, 2008
I'm using a VBscript that will copy a worksheet and it works perfectly except that it saves the copy to the same directory as the original workbook. I need it to save to a different directory.
What I believe is the pertinent part of the code that needs adjusting is:
"Input box to name new file
NewName = InputBox("Please Specify the name of your new workbook", "New Copy")
' Save it with the NewName and in the same directory as original
ActiveWorkbook.SaveCopyAs ThisWorkbook.Path & "" & NewName & ".xls"
ActiveWorkbook.Close SaveChanges:=False "
How would this be changed to specify that "NewName.xls" be saved to: D:/newdirectory/copies
View 9 Replies
View Related
Oct 13, 2009
I have a macro that creates and saves an XML file with a specific file name. Is there a way to modify this code in such a way that the user will be able to specify the path?
Set wb = Workbooks.Add
NewFileName = "Export For " _
& "Cust " & Customer_Data.Range("custName") _
& ", LOB " & RequestLOB _
& ", Type " & RequestType _
& ", Site " & RequestSite
On Error GoTo DoNotReplaceExistingFile
ActiveWorkbook.SaveAs Filename:=NewFileName & ".xml", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False
View 9 Replies
View Related
Oct 15, 2009
I think my code is close but I keep getting an error "Run-time error '1004': Application-defined or object-defined error"
I am trying to rename the active workbook by appending yesterday's date onto the filename, using the Save As.
I might be going about this all wrong anyway. My user needs the macro to save, rename, and close the renamed copy of the workbook but to leave the original workbook open. I'm trying to do it in steps so I might be doing this the hard way. However, my code to Save As is below:
Sub SaveAsRename()
Dim CurrentPath As String
Dim CurrentFileName As String
Dim NewFileName As String
Dim Today As Date
Today = Int(Range("A3") - 1) 'Cell A3 contains the =Today() formula
CurrentPath = ThisWorkbook.Path
CurrentFileName = "QU Backhaul Dispatch "
NewFileName = CurrentFileName & Today & ".xlsm"
ActiveWorkbook.SaveAs Filename:=CurrentPath & "" & NewFileName
End Sub
My Locals window has all of the correct values right up to the ActiveWorkbook.SaveAs which is where it fails.
View 9 Replies
View Related
Jul 12, 2006
I have written a routine that automatically saves the file to a specified folder as the name of a cell from one of the worksheets. I am trying to use the following code to see if that filename already exists and stop the routine if it does. If I manually enter an existing filename the routine works well, however I cannot get it to recognise the automatically created filename, here is my .....
View 9 Replies
View Related
Nov 21, 2006
I have the following
Private Sub cmdSave_Click()
SaveRow
On Error Goto ErrorHandler
ThisFile = Sheets("Data"). Range("B2").Value
ActiveWorkbook. SaveAs Filename:= _
"C:Documents and SettingsMy Documents" & ThisFile, FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False
Workbooks.Close
ErrorHandler:
MsgBox ("Error locating file. " + Err.Description)
End Sub
This saves a workbook with the File Name based on a cell in a worksheet in the above Path Name.
Is there a way that I can change this code to ask for the Path Name with the File Name, from the worksheet, as a default.
View 9 Replies
View Related
Jul 29, 2007
I have a code that opens a workbook and saves it under one file name and then saves it under 2 different file names, but it keeps on saving them as password protected and I can't work out why. Would it be something to do with the code or something else? The following is the code I am using:
Workbooks.Open "C:BatteriesStore InformationStores" & StoreFile
ActiveWorkbook.SaveAs "C:BatteriesStore InformationOld Stores" _
& StoreFile & " " & Format(Now, "d-mmm-yy"), xlNormal, Application.DisplayAlerts = False
ActiveWorkbook.SaveAs "C:BatteriesStore InformationStores" _
& StoreFile, xlNormal, Application.DisplayAlerts = False
View 2 Replies
View Related
Jun 24, 2008
I've got a workbook that I want to keep intact in a central location on our local network, to make it easier for everybody to access, but don't want people to be able to save changes to the master workbook itself. I'd like to be able to disable the 'Save' feature while still allowing 'SaveAs'. The following code (installed in ThisWorkbook) results in the OPPOSITE of what I'm trying to accomplish (i.e., it allows 'Save' but disables 'SaveAs'):
Private Sub Workbook_BeforeSave(ByVal SaveUI As Boolean, Cancel As Boolean)
If SaveUI Then
MsgBox "The 'Save' function for this workbook has " & Chr(10) & "been disabled. Please use 'Save As'.", vbOKOnly + vbInformation, "Save Disabled"
Cancel = True
End If
End Sub
Obviously I'd also like to check the filename they're performing the 'SaveAs' under and disallow it if it matches the master filename.
I've thought about making the workbook into a template, which would sort of accomplish the same thing, but it would be much easier to just keep it as a workbook.
View 9 Replies
View Related