ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SIMPLE msgbox Problem (https://www.excelbanter.com/excel-programming/411613-simple-msgbox-problem.html)

James8309

SIMPLE msgbox Problem
 
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\)





James8309

SIMPLE msgbox Problem
 
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

Gary Keramidas

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



Bob Phillips

SIMPLE msgbox Problem
 
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)



"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




All times are GMT +1. The time now is 03:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com