Re: change folder

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: TroyW (nospam_at_yahoo.com)
Date: 03/22/05


Date: Tue, 22 Mar 2005 17:59:12 -0500

John,

Disregard the previous information that I gave. It looks like you used the
MacroRecorder to record importing a file using the "Data | Import External
Data | Import Data..." command from the menubar.

You will need to modify the following line of code in
"ImportChurchSchedule":

From: "TEXT;C:\EMP3\Tab files for Excel\EM Church Schedule.tab",

To: "TEXT;C:\EMP4\Tab files for Excel\EM Church Schedule.tab",

Or you could repeat using the MacroRecorder to record importing the file
from it's new location

Troy

"John Garate" <j.garate@comcast.net> wrote in message
news:ediKVNxLFHA.2420@TK2MSFTNGP12.phx.gbl...
> Troy,
> I'm not sure what you are telling me. I really just starting to learn to
> use
> visual basic. I don't see the querytables commands you refer to. I've
> pasted
> a copy of the macro into this email.
>
>
>
> Sub ImportChurchSchedule()
> '
> ' ImportVisitSchedule Macro
> ' Macro recorded 2/11/2005 by Jag
> '
>
> '
> Range("B3").Select
> With Active***.QueryTables.Add(Connection:= _
> "TEXT;C:\EMP3\Tab files for Excel\EM Church Schedule.tab",
> Destination:=Range( _
> "B3"))
> .Name = "EM Visit Schedule"
> .FieldNames = True
> .RowNumbers = False
> .FillAdjacentFormulas = False
> .PreserveFormatting = True
> .RefreshOnFileOpen = False
> .RefreshStyle = xlInsertDeleteCells
> .SavePassword = False
> .SaveData = True
> .AdjustColumnWidth = True
> .RefreshPeriod = 0
> .TextFilePromptOnRefresh = False
> .TextFilePlatform = xlWindows
> .TextFileStartRow = 1
> .TextFileParseType = xlDelimited
> .TextFileTextQualifier = xlTextQualifierNone
> .TextFileConsecutiveDelimiter = False
> .TextFileTabDelimiter = True
> .TextFileSemicolonDelimiter = False
> .TextFileCommaDelimiter = False
> .TextFileSpaceDelimiter = False
> .TextFileColumnDataTypes = Array(1, 1, 1, 1)
> .Refresh BackgroundQuery:=False
> End With
> End Sub
> Sub FormateDateColumn()
> '
> ' FormateDateColumn Macro
> ' Macro recorded 2/11/2005 by Jag
> '
>
> '
> Columns("B:B").Select
> Selection.NumberFormat = "mm-dd"
> With Selection
> .HorizontalAlignment = xlLeft
> .VerticalAlignment = xlBottom
> .WrapText = False
> .Orientation = 0
> .AddIndent = False
> .IndentLevel = 0
> .ShrinkToFit = False
> .MergeCells = False
> End With
> Selection.NumberFormat = "mmm-dd"
> Range("F14").Select
> End Sub
> Sub InsertData()
> '
> ' InsertData Macro
> ' Macro recorded 2/11/2005 by Jag
> '
>
> '
> Application.Run "ImportVisitSchedule"
> Application.Run "SetColumnWidths"
> Application.Run "FormateDateColumn"
> End Sub
>
> Public Sub Auto_Open()
> Application.WindowState = xlMaximized
> End Sub


Quantcast