LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Reference dynamic filename

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





 
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
Dynamic Hyperlinks - Changing Folders and Filename Philip J Smith Excel Worksheet Functions 0 April 18th 07 12:24 PM
Reference in a filename.. Frode Hjoennevaag Excel Worksheet Functions 3 April 14th 05 02:47 PM
Toolbar & dynamic filename Steven Excel Programming 1 June 3rd 04 04:01 PM
Dynamic filename JC Excel Programming 8 March 5th 04 09:56 PM
Dynamic Filename From Macro Craig[_9_] Excel Programming 1 November 6th 03 06:36 PM


All times are GMT +1. The time now is 07:00 AM.

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

About Us

"It's about Microsoft Excel"