Rusty10
10-03-2007, 05:17 AM
Hi Everyone!
Firstly what a great resource this site is! Now for my first post!
I have just started using the wonderful VB within Excel and my knowledge is zero at the moment so was hoing somebody may be able to help?
I currently have the following code and I would like to change it from defaulting to the C:\Documents & Setting folder to a specific folder within a shared network drive?
Sub SaveSheet()
'error trap
On Error GoTo Etrap
Dim MyCell
MyCell = ActiveCell.Value
'ask user to save
If MsgBox("Save new workbook as " & CurDir & "\" & MyCell & ".xls?", vbYesNo) = vbNo Then
Exit Sub
End If
'check value of activecell
If MyCell = "" Then
MsgBox "Please check the Cell Value", vbInformation
Exit Sub
End If
'save activeworkbook as new workbook
ActiveWorkbook.SaveAs Filename:=MyCell & ".xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False
Etrap:
Beep
Exit Sub
End Sub
Any idea which part of the code I need to change? Am guessing it has something to do with the CurDir?
Many thanks!
Firstly what a great resource this site is! Now for my first post!
I have just started using the wonderful VB within Excel and my knowledge is zero at the moment so was hoing somebody may be able to help?
I currently have the following code and I would like to change it from defaulting to the C:\Documents & Setting folder to a specific folder within a shared network drive?
Sub SaveSheet()
'error trap
On Error GoTo Etrap
Dim MyCell
MyCell = ActiveCell.Value
'ask user to save
If MsgBox("Save new workbook as " & CurDir & "\" & MyCell & ".xls?", vbYesNo) = vbNo Then
Exit Sub
End If
'check value of activecell
If MyCell = "" Then
MsgBox "Please check the Cell Value", vbInformation
Exit Sub
End If
'save activeworkbook as new workbook
ActiveWorkbook.SaveAs Filename:=MyCell & ".xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False
Etrap:
Beep
Exit Sub
End Sub
Any idea which part of the code I need to change? Am guessing it has something to do with the CurDir?
Many thanks!