View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Mike[_95_] Mike[_95_] is offline
external usenet poster
 
Posts: 3
Default vba instruction for file saving

On Apr 16, 2:45*pm, umpire_43
wrote:
Hi,

I'm wondering if anyone can help me on this?

I'm using excel 2003.

I have several sheets that have different statements.

This is what i want to accomplish through vba.

1) I want the programming to automatically retrieve information from the
cell within the sheet that i'm currently working on. (Note: i have several
sheets within the workbook)
2) User will select the directory where they want to save the file but the
filename will automatically be put into the popup dialog box.
3) Save the file automatically as pertaining to number 1.

Is this possible?
I hope you can understand.

thanks
keith


Something like this?

'Ask for a path and then save a copy of the workbook in that path
'using the file name contained on the active worksheet in cell
"B3"

myPath = Application.InputBox("Enter a path to save the file")
If Mid(myPath, Len(myPath) - 1, 1) < "\" Then myPath = myPath &
"\"

ActiveWorkbook.SaveCopyAs myPath &
ActiveWorkbook.ActiveSheet.Range("B3").Value

--Best regards,
--Mike Jr.