vb 从txt文本导入数据到MSFlexGrid1,可以从第五行开始导入吗,代码怎么写?
2个回答
展开全部
当然可以了
dim sA as string
Open App.Path & "\1.ini" For Input As #1
dim iA as integer
do while not eof(1)
Line Input # 1,sA
ia=ia+1
if ia>4 then ‘从第五行开始处理
'写导入代码
end if
loop
dim sA as string
Open App.Path & "\1.ini" For Input As #1
dim iA as integer
do while not eof(1)
Line Input # 1,sA
ia=ia+1
if ia>4 then ‘从第五行开始处理
'写导入代码
end if
loop
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command1_Click()
Dim T As String, S() As String
Open "d:\vb.txt" For Input As #1
T = StrConv(InputB(LOF(1), 1), vbUnicode)
Close #1
S = Split(T, vbCrLf)
With MSFlexGrid1
.Rows = UBound(S) - 3
For i = 5 To UBound(S)
.TextMatrix(i - 4, 0) = S(i)
Next
End With
End Sub
'请参考。
Dim T As String, S() As String
Open "d:\vb.txt" For Input As #1
T = StrConv(InputB(LOF(1), 1), vbUnicode)
Close #1
S = Split(T, vbCrLf)
With MSFlexGrid1
.Rows = UBound(S) - 3
For i = 5 To UBound(S)
.TextMatrix(i - 4, 0) = S(i)
Next
End With
End Sub
'请参考。
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询