ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Variable VB to assign new sheet name (https://www.excelbanter.com/excel-worksheet-functions/31187-variable-vbulletin-assign-new-sheet-name.html)

Kevin M

Variable VB to assign new sheet name
 
Hi all, TIA..

I have this recorded:

Sub Macro6()
'
' Macro6 Macro
' Macro recorded 6/16/2005 by Chuck Marple
'
' Keyboard Shortcut: Ctrl+Shift+Z
'
Selection.Copy
ChDir "R:\Equipment Info\Spec Sheet Templates"
Workbooks.Open Filename:= _
"R:\Equipment Info\Spec Sheet Templates\A30-1670 (S.V.D.
Template).xls"
ActiveSheet.Paste
Application.CutCopyMode = False
ChDir _
"L:\#PRL EQUIPMENT SYSTEM\EQUIPMENT INFO\A30-TUBULARS\A30-1670
(Rotary Valve-safety-drilling)\2838"
ActiveWorkbook.SaveAs Filename:= _
"L:\#PRL EQUIPMENT SYSTEM\EQUIPMENT INFO\A30-TUBULARS\A30-1670
(Rotary Valve-safety-drilling)\2838\2838.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub

I'd like to assign a sheetname based on a variable (cell A6) to assign as
the save name instead of the name it's saving over, any insights would be
much appreciated.

Thanks,

Kevin M


All times are GMT +1. The time now is 01:14 AM.

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