Using multiple arrays

rhino4eva

Active Member
Joined
Apr 1, 2009
Messages
260
Office Version
  1. 2010
Platform
  1. Windows
So i have limited knowledge of importing from a text file. I recorded my actions and it seems to work ok.
i tried to move on from this as i wanted import different parts of the import on three different sheets
By using a for/next loop to move the worksheet on i was hoping to have three arrays to import on to each sheet.
However i just keep debugging and i feel i am missing something

anyone have any pointer please
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
First pointer: Post the code that you are trying to do what you want it to do.
 
Upvote 0
First pointer: Post the code that you are trying to do what you want it to do.
With ActiveSheet.QueryTables.Add(Connection:="TEXT;T:\nbcovgsadamonly.txt", _
Destination:=Range("$A$1"))
.Name = "nbcovgsadamonly"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 850
.TextFileStartRow = 4
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub


ok so this the recorded macro i want to import the txt onto three sheets in one workbook,
however i need to change the array for each of the sheets
 
Upvote 0
Is it array(1,1,1,1) and next time array(1,1,4,1) ?
 
Upvote 0
Solution
That's the idea .... Used a for) next loop substituting sheet number but I get an error message ???? Multiple connections
 
Upvote 0

Forum statistics

Threads
1,215,482
Messages
6,125,058
Members
449,206
Latest member
Healthydogs

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