SIMPLE msgbox Problem

  • Thread starter Thread starter James8309
  • Start date Start date
J

James8309

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\)
 
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
 
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


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
 
Reply in other thread not good enough for you?

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top