View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chichifo[_3_] Chichifo[_3_] is offline
external usenet poster
 
Posts: 1
Default Saving a TXT file keeping its current location

Hi Guys.

I have this macro that I created with your help:

Sub TXT_Preparation()
Sheets("Sheet1").Visible = True
Sheets("Sheet1").Select
range("A8").Select
Selection.End(xlDown).Select
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Delete Shift:=xlUp
Dim wb As Workbook
Dim wbName As String
Set wb = ActiveWorkbook
wbName = Left(wb.Name, Len(wb.Name) - 4)
wb.SaveAs Filename:= _
"C:\Documents and Settings\castilv\My Documents\BUDGET 2005\"
wbName & ".txt", _
FileFormat:=xlText, CreateBackup:=False
ActiveWindow.SelectedSheets.Visible = False
Sheets("BUDGET").Select
range("G8").Select
End Sub

How can I save this txt keeping its current location and not hard cod
"C:\Documents and Settings\castilv\My Documents\BUDGET 2005\" & wbNam
& ".txt",

--
Message posted from http://www.ExcelForum.com