Fill the formulas at adjacent columns by VBA

A

Angus

I import data from a text file and put it at Column A to Column F (by macro
with using “Edit text import†and “Fill down formulas with columns adjacent
to data†at Data Range Property), and the formula is from Column G to J.
However, the data in Column F is not always filled, sometimes it is blanked.
Therefore the formulas from column G to J is sometimes missing, how to fix it
by VBA.
 
C

Christmas May

I would like to help, but need more info on how your populating the cells in
A through F. Would you be willing to either post your code or email it
directly to (e-mail address removed)

Sincerely,

Christmas May
 
A

Angus

I use macro to record "edit text import" and make the path as ImportFile:

Dim ImportFile As String
ImportFile = MyPath & LastFile
ActiveWorkbook.Sheets("Data").Select
Range("A2").Select
With Selection.QueryTable
.Connection = "TEXT;" & ImportFile
.TextFilePlatform = 1252
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _
1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.TextFilePromptOnRefresh = False
.Refresh BackgroundQuery:=False
End With
 

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

Top