View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
external usenet poster
 
Posts: 2,494
Default SIMPLE msgbox Problem

this is just a simple bit of code, doesn't do any error checking because i don't
know what you're dealing with.

Sub save_it()
Dim FileToSave As String
Dim fPath As String
fPath = "C:\My Documents\"
FileToSave = Application.InputBox("Enter filename to save", "Save File", ,
, , , , 2)
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs (fPath & FileToSave & ".xls")
Application.DisplayAlerts = True
End Sub

--


Gary


"James8309" wrote in message
...
On May 28, 4:34 pm, James8309 wrote:
Hi everyone,

How do I program it in VBA in a way that;

1. Msgbox popping up for an input

2. Typing file name into msgbox

3. It saves it into hard drive (i.e. c:\Mydocument\)




Also How do I make the current workbook close without asking me "DO
YOU WANT TO SAVE" lol

thanks alot everyone