Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Saves as button

Hi

I have a small problem. I have made a button where when the user pess it
saves the current excel shetet in a specific file location. The current code
I use is.

Private Sub CommandButton1_Click()
With ActiveSheet
..Parent.SaveAs Filename:="N:\3 PTA & Vedligehold\6 Dokumentation\4 Plast\1
Sprøjtestøbemaskiner\190112\" & "Checkliste Sprøjtestøbemaskine" & " " &
..Range("C2").Value & ".xls", _
FileFormat:=xlWorkbookNormal
End With
' End Sub

As the directory folder changes according to a specific cell value I want to
automate this. In the example above the directory path is N:\3 PTA &
Vedligehold\6 Dokumentation\4 Plast\1 Sprøjtestøbemaskiner\190112\

190112 should change according to a specific celle value. How do I co this?
I've been trying something like this

..Parent.SaveAs Filename:="N:\3 PTA & Vedligehold\6 Dokumentation\4 Plast\1
Sprøjtestøbemaskiner\" & .Range("C2").Value & "\" & "Checkliste
Sprøjtestøbemaskine" & ".xls", _

Can you help?

Ticotion

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Saves as button

Private Sub CommandButton1_Click()
Const FILE_ROOT As String = _
"N:\3 PTA & Vedligehold\6 Dokumentation\4 Plast\" & _
"1 Sprøjtestøbemaskiner\<dir\Checkliste Sprøjtestøbemaskine"
With ActiveSheet
.Parent.SaveAs _
Filename:=Replace(FILE_ROOT, "<dir", .Range("C2").Value) &
".xls", _
FileFormat:=xlWorkbookNormal
End With

End Sub


--
__________________________________
HTH

Bob

"Ticotion" wrote in message
...
Hi

I have a small problem. I have made a button where when the user pess it
saves the current excel shetet in a specific file location. The current
code
I use is.

Private Sub CommandButton1_Click()
With ActiveSheet
.Parent.SaveAs Filename:="N:\3 PTA & Vedligehold\6 Dokumentation\4 Plast\1
Sprøjtestøbemaskiner\190112\" & "Checkliste Sprøjtestøbemaskine" & " " &
.Range("C2").Value & ".xls", _
FileFormat:=xlWorkbookNormal
End With
' End Sub

As the directory folder changes according to a specific cell value I want
to
automate this. In the example above the directory path is N:\3 PTA &
Vedligehold\6 Dokumentation\4 Plast\1 Sprøjtestøbemaskiner\190112\

190112 should change according to a specific celle value. How do I co
this?
I've been trying something like this

.Parent.SaveAs Filename:="N:\3 PTA & Vedligehold\6 Dokumentation\4 Plast\1
Sprøjtestøbemaskiner\" & .Range("C2").Value & "\" & "Checkliste
Sprøjtestøbemaskine" & ".xls", _

Can you help?

Ticotion



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Saves as button


That works. Thank you for your quick reply


"Bob Phillips" wrote:

Private Sub CommandButton1_Click()
Const FILE_ROOT As String = _
"N:\3 PTA & Vedligehold\6 Dokumentation\4 Plast\" & _
"1 Sprøjtestøbemaskiner\<dir\Checkliste Sprøjtestøbemaskine"
With ActiveSheet
.Parent.SaveAs _
Filename:=Replace(FILE_ROOT, "<dir", .Range("C2").Value) &
".xls", _
FileFormat:=xlWorkbookNormal
End With

End Sub


--
__________________________________
HTH

Bob

"Ticotion" wrote in message
...
Hi

I have a small problem. I have made a button where when the user pess it
saves the current excel shetet in a specific file location. The current
code
I use is.

Private Sub CommandButton1_Click()
With ActiveSheet
.Parent.SaveAs Filename:="N:\3 PTA & Vedligehold\6 Dokumentation\4 Plast\1
Sprøjtestøbemaskiner\190112\" & "Checkliste Sprøjtestøbemaskine" & " " &
.Range("C2").Value & ".xls", _
FileFormat:=xlWorkbookNormal
End With
' End Sub

As the directory folder changes according to a specific cell value I want
to
automate this. In the example above the directory path is N:\3 PTA &
Vedligehold\6 Dokumentation\4 Plast\1 Sprøjtestøbemaskiner\190112\

190112 should change according to a specific celle value. How do I co
this?
I've been trying something like this

.Parent.SaveAs Filename:="N:\3 PTA & Vedligehold\6 Dokumentation\4 Plast\1
Sprøjtestøbemaskiner\" & .Range("C2").Value & "\" & "Checkliste
Sprøjtestøbemaskine" & ".xls", _

Can you help?

Ticotion




Reply
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
What happens when Excel 07 saves? Cherry Black Excel Discussion (Misc queries) 3 August 23rd 07 06:05 PM
Are two Saves the same? clara Excel Programming 0 March 23rd 07 04:45 PM
A Button that saves a workbook in the background yasser Excel Programming 1 October 2nd 06 10:13 PM
button that opens open dialogs but saves path to sheet cereldine[_22_] Excel Programming 7 April 28th 06 12:08 PM
counting saves msfphish Excel Discussion (Misc queries) 2 March 28th 06 05:42 PM


All times are GMT +1. The time now is 06:34 PM.

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

About Us

"It's about Microsoft Excel"