Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default code to SAVE

Hi experts,

using Excel '03...

My company is trying to save its xls documents (and other MS docs) in
a particular format; e.g., Program_Desc_Date_Initials.

Is there a way to code Excel (possibly placing the code in Book.xlt)
that prompts/asks the user (when the user executes SAVE or SAVE AS) to
enter the appropriate program, description, date, and his/her
initials. I'm thinking four input boxes (one after the other).

This data from the user would be concatenated and would form the file
name (now located in the Save As dialog box). The user would then
simply choose a location.

Thoughts?

alex
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default code to SAVE

yes, you have the right group. and i know what you describe can be
done within the macro - don't know about using the saveas dialogue or
before_saveas event but i suspect that can also be done, too (just
don't know how). as an example:

sProgram = inputbox1.value
sDesc = inputbox2.value
sDate = inputbox3.value
sInitials = inputbox4.value

wb.SaveAs Filename:=sProgram & "_" & sDesc & "_" & sDate & "_" &
sInitials & ".xls"

might get you started.
sorry can't be of more help.
susan


On May 15, 10:27*am, alex wrote:
On May 14, 1:07*pm, alex wrote:





Hi experts,


using Excel '03...


My company is trying to save its xls documents (and other MS docs) in
a particular format; e.g., Program_Desc_Date_Initials.


Is there a way to code Excel (possibly placing the code in Book.xlt)
that prompts/asks the user (when the user executes SAVE or SAVE AS) to
enter the appropriate program, description, date, and his/her
initials. *I'm thinking four input boxes (one after the other).


This data from the user would be concatenated and would form the file
name (now located in the Save As dialog box). *The user would then
simply choose a location.


Thoughts?


alex


Can someone tell me if I posted this question to the wrong group?

Thanks,
alex- Hide quoted text -

- Show quoted text -


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default code to SAVE

here's a link to a post that may be of additional help:
http://groups.google.com/group/micro... 3fde91588835b

try searching the newsgroup for the different components of your
problem.
susan


On May 15, 10:27*am, alex wrote:
On May 14, 1:07*pm, alex wrote:





Hi experts,


using Excel '03...


My company is trying to save its xls documents (and other MS docs) in
a particular format; e.g., Program_Desc_Date_Initials.


Is there a way to code Excel (possibly placing the code in Book.xlt)
that prompts/asks the user (when the user executes SAVE or SAVE AS) to
enter the appropriate program, description, date, and his/her
initials. *I'm thinking four input boxes (one after the other).


This data from the user would be concatenated and would form the file
name (now located in the Save As dialog box). *The user would then
simply choose a location.


Thoughts?


alex


Can someone tell me if I posted this question to the wrong group?

Thanks,
alex- Hide quoted text -

- Show quoted text -


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default code to SAVE

last one, i promise

http://groups.google.com/group/micro...dae68355e0257d

susan


On May 15, 10:27*am, alex wrote:
On May 14, 1:07*pm, alex wrote:





Hi experts,


using Excel '03...


My company is trying to save its xls documents (and other MS docs) in
a particular format; e.g., Program_Desc_Date_Initials.


Is there a way to code Excel (possibly placing the code in Book.xlt)
that prompts/asks the user (when the user executes SAVE or SAVE AS) to
enter the appropriate program, description, date, and his/her
initials. *I'm thinking four input boxes (one after the other).


This data from the user would be concatenated and would form the file
name (now located in the Save As dialog box). *The user would then
simply choose a location.


Thoughts?


alex


Can someone tell me if I posted this question to the wrong group?

Thanks,
alex- Hide quoted text -

- Show quoted text -


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default code to SAVE

On May 15, 11:24*am, Susan wrote:
last one, i promise

http://groups.google.com/group/micro...rogramming/bro...

susan

On May 15, 10:27*am, alex wrote:



On May 14, 1:07*pm, alex wrote:


Hi experts,


using Excel '03...


My company is trying to save its xls documents (and other MS docs) in
a particular format; e.g., Program_Desc_Date_Initials.


Is there a way to code Excel (possibly placing the code in Book.xlt)
that prompts/asks the user (when the user executes SAVE or SAVE AS) to
enter the appropriate program, description, date, and his/her
initials. *I'm thinking four input boxes (one after the other).


This data from the user would be concatenated and would form the file
name (now located in the Save As dialog box). *The user would then
simply choose a location.


Thoughts?


alex


Can someone tell me if I posted this question to the wrong group?


Thanks,
alex- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -


Thanks for your help Susan. I'll take a look at these and see if I
can extrapolate something.

alex


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default code to SAVE

On May 15, 12:43*pm, alex wrote:
On May 15, 11:24*am, Susan wrote:





last one, i promise


http://groups.google.com/group/micro...rogramming/bro...


susan


On May 15, 10:27*am, alex wrote:


On May 14, 1:07*pm, alex wrote:


Hi experts,


using Excel '03...


My company is trying to save its xls documents (and other MS docs) in
a particular format; e.g., Program_Desc_Date_Initials.


Is there a way to code Excel (possibly placing the code in Book.xlt)
that prompts/asks the user (when the user executes SAVE or SAVE AS) to
enter the appropriate program, description, date, and his/her
initials. *I'm thinking four input boxes (one after the other).


This data from the user would be concatenated and would form the file
name (now located in the Save As dialog box). *The user would then
simply choose a location.


Thoughts?


alex


Can someone tell me if I posted this question to the wrong group?


Thanks,
alex- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -


Thanks for your help Susan. *I'll take a look at these and see if I
can extrapolate something.

alex- Hide quoted text -

- Show quoted text -


I've got most of the code to work and pasted it below:

Sub xlsSaveAs()

Dim SaveName1 As String
Dim SaveName2 As String
Dim SaveName3 As String
Dim SaveName4 As String
Dim Why As Integer

Why = MsgBox("Would You Like To Use Special Formatting?", vbYesNo,
"File Formatting")

If Why = vbYes Then
SaveName1 = InputBox("PLEASE ENTER PROGRAM
DESCRIPTION")

Application.Dialogs(xlDialogSaveAs).Show SaveName1

Else
Application.Dialogs(xlDialogSaveAs).Show

End If
End Sub

I have a problem, however, with concatenating the results of all my
input boxes. I can show them; e.g.:

If Why = vbYes Then
SaveName1 = InputBox("PLEASE ENTER PROGRAM
DESCRIPTION")
SaveName2 = InputBox("PLEASE ENTER DESC")
SaveName3 = InputBox("PLEASE ENTER DATE")
SaveName4 = InputBox("PLEASE ENTER INITIALS")

but I cannot combine the results.

I also thought about creating one UserForm with four textboxes. I can
call the Form, but I don't know enough to pull the user defined text
from the textboxes.

thoughts?
alex
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default code to SAVE

On May 15, 3:39*pm, alex wrote:
On May 15, 12:43*pm, alex wrote:





On May 15, 11:24*am, Susan wrote:


last one, i promise


http://groups.google.com/group/micro...rogramming/bro....


susan


On May 15, 10:27*am, alex wrote:


On May 14, 1:07*pm, alex wrote:


Hi experts,


using Excel '03...


My company is trying to save its xls documents (and other MS docs) in
a particular format; e.g., Program_Desc_Date_Initials.


Is there a way to code Excel (possibly placing the code in Book.xlt)
that prompts/asks the user (when the user executes SAVE or SAVE AS) to
enter the appropriate program, description, date, and his/her
initials. *I'm thinking four input boxes (one after the other).


This data from the user would be concatenated and would form the file
name (now located in the Save As dialog box). *The user would then
simply choose a location.


Thoughts?


alex


Can someone tell me if I posted this question to the wrong group?


Thanks,
alex- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -


Thanks for your help Susan. *I'll take a look at these and see if I
can extrapolate something.


alex- Hide quoted text -


- Show quoted text -


I've got most of the code to work and pasted it below:

Sub xlsSaveAs()

Dim SaveName1 As String
Dim SaveName2 As String
Dim SaveName3 As String
Dim SaveName4 As String
Dim Why As Integer

Why = MsgBox("Would You Like To Use Special Formatting?", vbYesNo,
"File Formatting")

* * * * * * If Why = vbYes Then
* * * * * * * * * * SaveName1 = InputBox("PLEASE ENTER PROGRAM
DESCRIPTION")

* * * * * * * * * * Application.Dialogs(xlDialogSaveAs).Show SaveName1

* * * * * * Else
* * * * * * * * * * Application.Dialogs(xlDialogSaveAs).Show

* * End If
End Sub

I have a problem, however, with concatenating the results of all my
input boxes. *I can show them; e.g.:

If Why = vbYes Then
* * * * * * * * * *SaveName1 = InputBox("PLEASE ENTER PROGRAM
DESCRIPTION")
* * * * * * * * * * SaveName2 = InputBox("PLEASE ENTER DESC")
* * * * * * * * * * * SaveName3 = InputBox("PLEASE ENTER DATE")
* * * * * * * * * * * * SaveName4 = InputBox("PLEASE ENTER INITIALS")

but I cannot combine the results.

I also thought about creating one UserForm with four textboxes. *I can
call the Form, but I don't know enough to pull the user defined text
from the textboxes.

thoughts?
alex- Hide quoted text -

- Show quoted text -


Hello all.

Could someone tell me the code to extract the "User name" from Excel?
Located under Tools | Options | General |

Instead of requiring the user to enter his/her initials, I could
concatenate the Program&_&Description&_&Date&_&User name.

alex
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save As Code Bernie Deitrick Excel Programming 0 January 4th 07 04:20 PM
How to save my VBA-code Heine Excel Worksheet Functions 4 September 26th 06 05:46 PM
Totally Disabling (^ save ) (Save as) and Save Icon – Which code do I use: harpscardiff[_10_] Excel Programming 8 November 10th 05 12:24 PM
Placing a code before Save & Save As Alex Martinez Excel Programming 1 September 27th 05 06:35 AM
SAVE AS code narutard[_20_] Excel Programming 1 July 21st 05 03:16 PM


All times are GMT +1. The time now is 03:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"