LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to Save As to a specific location

I have a Macro that I want to save the file using the date that's listed in a
specific cell, however I want the file to be placed in a specific folder.
Below is the code I'm using, however It does not saving it in
"T:\MBRProjects\Reports\Weekly Hour Forms\" it saves the file to the last
folder I was in. How do I correct this?

Sub FridayUploadPrep()
'
' FridayUploadPrep Macro
' Macro recorded 9/28/2006 by Charlene Parker
'

'
Sheets("Friday").Select

Dim wb As Workbook
Dim ws As Worksheet
Dim varVal As Variant
Dim strFileName As String
Dim strPath As String

Set wb = ActiveWorkbook
Set ws = wb.Worksheets("Friday")
varVal = ws.Range("N1").Value
strPath = "T:\MBRProjects\Reports\Weekly Hour Forms\"

If IsDate(varVal) Then
strFileName = "NPBR " & Format(CStr(varVal), "mm-dd-yyyy") & ".xls"
Else
strFileName = "NPBR " & Format(CStr(Date), "mm-dd-yyyy") & "saved.xls"
End If

ActiveWorkbook.SaveAs Filename:=strPahtName & strFileName

Set wb = Nothing
Set ws = Nothing

End Sub



 
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
Macro to Save File to specific location when closing paankadu Excel Discussion (Misc queries) 3 October 26th 09 11:52 PM
Auto save Spread sheet as htm to a specific location Saving is tough Excel Discussion (Misc queries) 0 October 29th 08 03:46 PM
Macro - save to current location vs excel default location leezard Excel Discussion (Misc queries) 0 October 28th 08 03:04 PM
Macro uses "Save As" to a specific location kyle Excel Programming 1 August 9th 06 07:30 PM
Save to specific location LB79 Excel Discussion (Misc queries) 2 August 25th 05 11:02 AM


All times are GMT +1. The time now is 08:48 AM.

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

About Us

"It's about Microsoft Excel"