B
Bob Maloney
I have the following part code included in macro 1:
Dim spath As String
spath = Range("B3").Value
ActiveWorkbook.SaveAs spath & ".xls"
(The text in range B3 is:
C:\Documents and Settings\Agents\07_11_14 Daily Withdrawal Team 1)
In macros 2, 3, 4, etc. I repeatedly copy and paste a dynamic sheet into
Daily Withdrawal Team 3.xls by referencing with hard code:
Sheets("Output").Select
Sheets("Output").Copy After:=Workbooks("07_11_14 Daily Withdrawal Team
1.xls").Sheets(1)
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
With ActiveSheet
.Name = Range("D1").Value
.Move After:=Sheets(Sheets.Count)
End With
Problem:
As the date component of the filename (07_11_14 ) will be dynamic, is there
any way to reference this in macros 2, 3, 4, etc without the need to
manually <Edit> <Replace> in VB?
Any assistance greatly appreciated
Cheers
Ozbobeee
Dim spath As String
spath = Range("B3").Value
ActiveWorkbook.SaveAs spath & ".xls"
(The text in range B3 is:
C:\Documents and Settings\Agents\07_11_14 Daily Withdrawal Team 1)
In macros 2, 3, 4, etc. I repeatedly copy and paste a dynamic sheet into
Daily Withdrawal Team 3.xls by referencing with hard code:
Sheets("Output").Select
Sheets("Output").Copy After:=Workbooks("07_11_14 Daily Withdrawal Team
1.xls").Sheets(1)
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
With ActiveSheet
.Name = Range("D1").Value
.Move After:=Sheets(Sheets.Count)
End With
Problem:
As the date component of the filename (07_11_14 ) will be dynamic, is there
any way to reference this in macros 2, 3, 4, etc without the need to
manually <Edit> <Replace> in VB?
Any assistance greatly appreciated
Cheers
Ozbobeee