ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Changes to a VBA code (https://www.excelbanter.com/excel-discussion-misc-queries/49918-changes-vba-code.html)

[email protected]

Changes to a VBA code
 
Hi Guys, I got this awhile back, and VBA not being my strongest area I
was just wondering if it could be changed? I need to change instead of
using "Client Name.xls" I need the text in cell "B13" to be used which
would be the clients name. Any help would be great Thanks

Sub SaveOneFile()
Dim fn As Variant
fn = Application.GetSaveAsFilename("Client Name.xls", _
"Quote Form,*.xls", 1, "Select your folder and filename")
If TypeName(fn) = "Boolean" Then Exit Sub
ActiveWorkbook.SaveAs fn
End Sub


Mangesh Yadav

fn = Application.GetSaveAsFilename(Worksheets("Sheet1") .Range("B13"), _
"Quote Form,*.xls", 1, "Select your folder and filename")

Please change the worksheet name as per your requirement

Mangesh




wrote in message
oups.com...
Hi Guys, I got this awhile back, and VBA not being my strongest area I
was just wondering if it could be changed? I need to change instead of
using "Client Name.xls" I need the text in cell "B13" to be used which
would be the clients name. Any help would be great Thanks

Sub SaveOneFile()
Dim fn As Variant
fn = Application.GetSaveAsFilename("Client Name.xls", _
"Quote Form,*.xls", 1, "Select your folder and filename")
If TypeName(fn) = "Boolean" Then Exit Sub
ActiveWorkbook.SaveAs fn
End Sub




[email protected]

Fantastic that works great, the only problem I have is this code is
used in six sheets all with different titles. I'm not sure how to write
this into the code.


Jim May

Maybe Instead of using the

Worksheets("Sheet1")

try:

Activesheet



wrote in message
oups.com...
Fantastic that works great, the only problem I have is this code is
used in six sheets all with different titles. I'm not sure how to write
this into the code.





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

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