jammer6_9
12-04-2011, 02:43 PM
I was trying to save a workbook and giving it an initial file name based on a cell value but :banghead: :banghead: :banghead:
Sub Extract_JV()
Dim wb As New Workbook
Dim sFile As Variant
Sheets("JV").Visible = True
inti = MsgBox("JV worksheet will be process, do you want to continue?", vbYesNo + vbQuestion, "ofsjcr")
If inti = 6 Then
Sheets(Array("JV")).Copy
Set wb = ActiveWorkbook
'here i want to give an initial filename based on the value of sheet("JV").range("f47")
sFile = Application.GetSaveAsFilename(InitialFileName:=wb.Sheets("JV").Range("F47").Value, fileFilter:="Microsoft Office Excel Workbook (*.xls), *.xls", Title:="Save workbook to..")
If sFile <> False Then
ActiveWorkbook.SaveAs Filename:=sFile
ThisWorkbook.Saved = True
End If
End If
Sub Extract_JV()
Dim wb As New Workbook
Dim sFile As Variant
Sheets("JV").Visible = True
inti = MsgBox("JV worksheet will be process, do you want to continue?", vbYesNo + vbQuestion, "ofsjcr")
If inti = 6 Then
Sheets(Array("JV")).Copy
Set wb = ActiveWorkbook
'here i want to give an initial filename based on the value of sheet("JV").range("f47")
sFile = Application.GetSaveAsFilename(InitialFileName:=wb.Sheets("JV").Range("F47").Value, fileFilter:="Microsoft Office Excel Workbook (*.xls), *.xls", Title:="Save workbook to..")
If sFile <> False Then
ActiveWorkbook.SaveAs Filename:=sFile
ThisWorkbook.Saved = True
End If
End If