Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Copy cells from a excel file that filename changes daily.

I have a file titled FP Skill by 15 min_12345678.XLS. Howeve each day
the _12345678 part of the file name changes.

I wuold like to open that file and copy some cells out of it with a
macro. The one below works fine if I have the excat name of the file in
it, but I would like it to just open any file LIKE FP Skill by 15
min_*.XLS. The astrick does not work for me.

Sub GetFPSkillby15()
Workbooks.Open Filename:= _
"FP Skill by 15 min_*.XLS"
Rows("1:65").Select
Selection.Copy
Windows("David of Chart Daily-FP 08-10-06.xls").Activate
Range("A26").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
Sheets("Data Input").Select
End Sub

Any ideas.

Both files are located in the same folder.

David

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Copy cells from a excel file that filename changes daily.

Sub GetFPSkillby15()
sname = Dir("FP Skill by 15 Min_*.xls")
Workbooks.Open Filename:= _
sName
Rows("1:65").Select
Selection.Copy
Windows("David of Chart Daily-FP 08-10-06.xls").Activate
Range("A26").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
Sheets("Data Input").Select
End Sub

--
Regards,
Tom Ogilvy



"gumby" wrote:

I have a file titled FP Skill by 15 min_12345678.XLS. Howeve each day
the _12345678 part of the file name changes.

I wuold like to open that file and copy some cells out of it with a
macro. The one below works fine if I have the excat name of the file in
it, but I would like it to just open any file LIKE FP Skill by 15
min_*.XLS. The astrick does not work for me.

Sub GetFPSkillby15()
Workbooks.Open Filename:= _
"FP Skill by 15 min_*.XLS"
Rows("1:65").Select
Selection.Copy
Windows("David of Chart Daily-FP 08-10-06.xls").Activate
Range("A26").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
Sheets("Data Input").Select
End Sub

Any ideas.

Both files are located in the same folder.

David


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Copy cells from a excel file that filename changes daily.

Thank you -

Tom Ogilvy wrote:
Sub GetFPSkillby15()
sname = Dir("FP Skill by 15 Min_*.xls")
Workbooks.Open Filename:= _
sName
Rows("1:65").Select
Selection.Copy
Windows("David of Chart Daily-FP 08-10-06.xls").Activate
Range("A26").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
Sheets("Data Input").Select
End Sub

--
Regards,
Tom Ogilvy



"gumby" wrote:

I have a file titled FP Skill by 15 min_12345678.XLS. Howeve each day
the _12345678 part of the file name changes.

I wuold like to open that file and copy some cells out of it with a
macro. The one below works fine if I have the excat name of the file in
it, but I would like it to just open any file LIKE FP Skill by 15
min_*.XLS. The astrick does not work for me.

Sub GetFPSkillby15()
Workbooks.Open Filename:= _
"FP Skill by 15 min_*.XLS"
Rows("1:65").Select
Selection.Copy
Windows("David of Chart Daily-FP 08-10-06.xls").Activate
Range("A26").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
Sheets("Data Input").Select
End Sub

Any ideas.

Both files are located in the same folder.

David



Reply
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
copy cells daily and automatically RJJ Excel Worksheet Functions 3 May 10th 09 01:01 PM
Auto save file copy with unique filename Allen Excel Worksheet Functions 1 June 27th 06 08:18 PM
EXCEL FILE a copy/a copy/a copy ....filename ve New Users to Excel 1 September 29th 05 09:12 PM
Filename changes daily, anyway to link to most recent file David Excel Programming 0 September 24th 04 04:34 PM
Macro to copy daily text file Cheryl[_4_] Excel Programming 1 May 27th 04 05:46 AM


All times are GMT +1. The time now is 01:13 PM.

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"