View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default VBA:Populating Cells/List From External Data

I created a file on the Desktop called:

data.mark1

I imported the data manually with the Recorder turned on and got:

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 4/12/2008 by James Ravenswood
'

'
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Documents and Settings\Owner\Desktop\data.mark1",
Destination:=Range _
("D1"))
.Name = "data.mark1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileOtherDelimiter = "#"
.TextFileColumnDataTypes = Array(1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub

--
Gary''s Student - gsnu2007g


" wrote:

Ok, so that's how to split the string - but I still need help on:-

a). when a cell is selected, reading the data into a list from the
external source.
b). populating the 3 different cells, player, club, cost.
c). checking for existance of more than 2 clubs.

cheers.