External data range properties

  • Thread starter Thread starter Baz
  • Start date Start date
B

Baz

Hi, hope someone can help me with this problem.

In External data range properties it always defaults to
middle option. "Insert entire rows for new data, clear
unused cells". Can it be kept to the bottom
option. "Overwrite cells with new data, clear unused
cells". Any ideas??

..
 
I use xl2002 and I think the menu system changed wording, but that menu is
pretty down the chain of events when you're importing your data.

If your data is always the same, maybe you could record a macro when you do it
once.

I got this when I did it:

Option Explicit

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 09/20/2003 by David Peterson
'

'
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\My Documents\excel\test.csv", Destination:=Range("A1"))
.Name = "test"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub

That .refreshstyle looks like it represents what you want.

You can see more info in the help.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

(By the way, "insert entire rows..." is the middle of three options in xl2002.
"overwrite..." is the third and "insert new cells..." is the top one.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top