Perform additional tasks with a text import macro

suprsnipes

Active Member
Joined
Apr 26, 2009
Messages
434
Hi,

I would like to add the following to the macro below;

After each refresh I want Excel to bring in view the last entry to the centre of the spreadsheet. Is this possible?

Code:
Sub Macro2()
'
' Macro2 Macro
'

'
    With Selection.QueryTable
        .Connection = "TEXT;\\8b22801\c\q\130610"
        .RefreshPeriod = 1
        .TextFilePlatform = 437
        .TextFileStartRow = 1
        .TextFileParseType = xlFixedWidth
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = True
        .TextFileSemicolonDelimiter = False
        .TextFileCommaDelimiter = False
        .TextFileSpaceDelimiter = False
        .TextFileColumnDataTypes = Array(1, 1, 9, 9, 1, 1, 9, 1, 9, 1, 1, 9)
        .TextFileFixedColumnWidths = Array(6, 6, 1, 2, 5, 5, 5, 4, 4, 4, 2)
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=False
   
End With
End Sub

Appreciate the help,
suprsnipes
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,224,565
Messages
6,179,549
Members
452,927
Latest member
rows and columns

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top