ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Search macro adjustment (https://www.excelbanter.com/excel-programming/367063-search-macro-adjustment.html)

TomBP[_13_]

Search macro adjustment
 

I'm making use of the following save macro at the moment:


Code:
--------------------
Sub Save()
'
' Save Macro
' Macro recorded 7/07/2006 by BPPassPort User
'
' Keyboard Shortcut: Ctrl+t
'
Dim s As String, s1 As String
s = ActiveSheet.Range("F10").Text
s1 = "C:\Documents and Settings\" & _
"fackt0\Desktop\Excel probleem\Shipments\"
ActiveWorkbook.SaveAs _
Filename:=s1 & s & ".xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False
End Sub
--------------------



_What_does_it_do?_
When I run my save macro by pushing the Save button it will save the
document as the name 6666.xls in the map Shipments on my desktop.

_What_is_the_problem?_
It closes my original xls file (Receipt Note - Tom Fack.xls) and
changes it to 6666.xls.

_What_do_I_want?_
I want it to save 6666.xls to the map shipments but I want to continue
working in the original xls file (Receipt Note - Tom Fack.xls). So when
I press save, it looks like nothing happened. An extra feature would be
that when people press save a message will pop up with "Your file has
been saved".

Here are some pictures so you can see what I'm talking about:

[image: http://i54.photobucket.com/albums/g1...savemacro.jpg]

[image: http://i54.photobucket.com/albums/g115/TomBP/6666.jpg]


--
TomBP
------------------------------------------------------------------------
TomBP's Profile: http://www.excelforum.com/member.php...o&userid=36112
View this thread: http://www.excelforum.com/showthread...hreadid=560992


Ardus Petus

Search macro adjustment
 
Use SaveCopyAs instead of SaveAs

HTH
--
AP

"TomBP" a écrit dans le
message de news: ...

I'm making use of the following save macro at the moment:


Code:
--------------------
Sub Save()
'
' Save Macro
' Macro recorded 7/07/2006 by BPPassPort User
'
' Keyboard Shortcut: Ctrl+t
'
Dim s As String, s1 As String
s = ActiveSheet.Range("F10").Text
s1 = "C:\Documents and Settings\" & _
"fackt0\Desktop\Excel probleem\Shipments\"
ActiveWorkbook.SaveAs _
Filename:=s1 & s & ".xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False
End Sub
--------------------



_What_does_it_do?_
When I run my save macro by pushing the Save button it will save the
document as the name 6666.xls in the map Shipments on my desktop.

_What_is_the_problem?_
It closes my original xls file (Receipt Note - Tom Fack.xls) and
changes it to 6666.xls.

_What_do_I_want?_
I want it to save 6666.xls to the map shipments but I want to continue
working in the original xls file (Receipt Note - Tom Fack.xls). So when
I press save, it looks like nothing happened. An extra feature would be
that when people press save a message will pop up with "Your file has
been saved".

Here are some pictures so you can see what I'm talking about:

[image:
http://i54.photobucket.com/albums/g1...savemacro.jpg]

[image: http://i54.photobucket.com/albums/g115/TomBP/6666.jpg]


--
TomBP
------------------------------------------------------------------------
TomBP's Profile:
http://www.excelforum.com/member.php...o&userid=36112
View this thread: http://www.excelforum.com/showthread...hreadid=560992




TomBP[_16_]

Search macro adjustment
 

I did what you said and it gave the following error:

[image:
http://i54.photobucket.com/albums/g1...avebutton.jpg]


--
TomBP
------------------------------------------------------------------------
TomBP's Profile: http://www.excelforum.com/member.php...o&userid=36112
View this thread: http://www.excelforum.com/showthread...hreadid=560992


Ardus Petus

Search macro adjustment
 
Sub Save()
'
' Save Macro
' Macro recorded 7/07/2006 by BPPassPort User
'
' Keyboard Shortcut: Ctrl+t
'
Dim s As String, s1 As String
s = ActiveSheet.Range("F10").Text
s1 = "C:\Documents and Settings\" & _
"fackt0\Desktop\Excel probleem\Shipments\"
ActiveWorkbook.SaveCopyAs _
Filename:=s1 & s & ".xls"
End Sub


HTH
--
AP

"TomBP" a écrit dans le
message de news: ...

I did what you said and it gave the following error:

[image:
http://i54.photobucket.com/albums/g1...avebutton.jpg]


--
TomBP
------------------------------------------------------------------------
TomBP's Profile:
http://www.excelforum.com/member.php...o&userid=36112
View this thread: http://www.excelforum.com/showthread...hreadid=560992




TomBP[_17_]

Search macro adjustment
 

It works now. Thank you for your help.


--
TomBP
------------------------------------------------------------------------
TomBP's Profile: http://www.excelforum.com/member.php...o&userid=36112
View this thread: http://www.excelforum.com/showthread...hreadid=560992



All times are GMT +1. The time now is 09:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com