#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Tweaking VBA

Hi

I hope this is reasonably straightforward.

I've recorded a macro to pull data from a text file into the Data Wizard and populate a worksheet. The problem is that I can only link to a specific file, but we get 1 file per day. So what I was wondering, is - is there an easy way to change this script:

With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;\\finance\docs\00222020112912TT.txt" _
, Destination:=Range("$A$6"))

so that the '20112912' (YYYYDDMM) part of the file referred to is replaced by the contents of a cell? 00222 is our office designation, and is part of every txt file, as is the 'TT'.

My thought was to have say, C1, as an input cell where the YYYYDDMM date is input. Another cell links the '\\finance\docs\001540' & C1 & 'TT.txt'

Does anyone have any ideas on how to do this, please; any answers would be greatly appreciated.

Thanks

Steve
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Tweaking VBA

.... not sure where the 001540 comes from near the end; should have said 00222.
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
a little tweaking might work? Heather Excel Programming 4 August 26th 09 06:28 PM
Tweaking Macros Nick H[_2_] Excel Programming 6 July 6th 09 02:44 AM
Code needs tweaking :P Jock Excel Programming 2 August 14th 07 09:38 AM
Tweaking Code Richard Excel Programming 3 February 25th 06 07:15 PM
Tweaking Code Richard Excel Programming 2 February 25th 06 02:23 AM


All times are GMT +1. The time now is 01:52 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"