LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Open & delete file using a macro

Hi,

I recieve an excel file daily which has the date attached to the end of the
file name - ie Agent_SCCS12042007. How can I amend my script below to :
(1) have the macro open the file & import the data regardless of the date
information
(2) then delete this file from the d:drive

thanks!


ChDir "D:\UserData\userid\My Documents\Daily Telephony\new extracts to update"
Workbooks.Open Filename:="D:\UserData\userid\My Documents\Daily
Telephony\new extracts to update\Agent_SCCS"
ActiveWindow.SmallScroll ToRight:=10
Range("Q1").Select
Range(Selection, Selection.End(xlDown)).Select
Range("Q1:AC391").Select
Selection.Copy
Windows("Macro for scrubbing extract data.xls").Activate
Sheets("AGENT_SCCS").Select
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Windows("Agent_SCCS.csv").Activate
ActiveWindow.Close
 
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
Macro to run on file open Marie Bayes Excel Discussion (Misc queries) 17 November 5th 08 07:47 PM
Open File within a macro Rob Excel Discussion (Misc queries) 10 June 29th 06 08:55 PM
Can't find macro in an Excel file to delete it Ron Excel Discussion (Misc queries) 3 July 1st 05 01:07 PM
Delete/Close Excel file that is kept OPEN Jafer New Users to Excel 0 April 15th 05 05:34 AM
open file (as variable) from macro d chaps Excel Discussion (Misc queries) 1 March 14th 05 11:57 PM


All times are GMT +1. The time now is 12:50 PM.

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

About Us

"It's about Microsoft Excel"