Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() In second last row of code i get error type mismatch, I'm nearly there , but have been looking at this so long , I can't get it, Can anyone please help me finish this off . Thanks again everyone for all your help. Sub Importdata() Dim iFno As Integer Dim sFName As Variant Dim sLine As String, sAccntNo As String Dim vRow As Variant vFName = Application.GetOpenFilename("Text Files (*.txt), *.txt") If vFName = False Then Exit Sub iFno = FreeFile() Open vFName For Input As #iFno Do While Not EOF(iFno) Line Input #iFno, sLine ' account number is 1st 10 characters? sAccntNo = Left$(sLine, 10) ' loop up the account number in the 1st column vRow = WorksheetFunction.Match(CDbl(sAccntNo), ActiveSheet.Columns(1), 0) If IsError(vRow) Then MsgBox "Account " & sAccntNo & " does not exist", vbExclamation Else ' week1 in column 4, week1's amount in input line at pos 22-26 ActiveSheet.Cells(vRow, 4) = CDbl(Mid$((sLine), 22, 5)) "error code 13 type mismatch" End If Loop Close #iFno End Sub -- tom mcdonald ------------------------------------------------------------------------ tom mcdonald's Profile: http://www.excelforum.com/member.php...o&userid=24369 View this thread: http://www.excelforum.com/showthread...hreadid=380483 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to convert a dotted line to a solid line in a line graph | Charts and Charting in Excel | |||
coloring overy other line without doing so line by line | Excel Worksheet Functions | |||
Macro problem on, Yellowed line - previous line or next line. | Excel Programming | |||
Quick name deletion line required | Excel Programming | |||
Reads entire *.txt file into string opposed to a desired line by line input. | Excel Programming |