用vb程式設計,怎麼將csv檔案中的資料的某一列取出來(假設n行8列,我要第二列的所有資料),要取

時間 2022-09-03 13:42:03

1樓:

示意:(注意,不是示例)

dim s(0) as string,tmp() as stringdo while not fileend '應該是 eoftmp = split(readnewline,",") '讀一行,並以逗號分切為字串陣列

if ubound(tmp)>=2 then '若存在第二列s(ubound(s)) = tmp(2) '儲存在s的最後乙個元素中

redim preserve s(ubound(s)+1) 's擴充套件乙個

end if

loop

大概意思是這樣了。

用vb程式設計,怎麼從excel或txt(有n行6列)中取其中一列資料,要乙個乙個的取,小弟菜鳥,望大蝦指教

2樓:匿名使用者

dim i as long

for i=1 to n

msgbox cells(i,x)

next

x表示你要讀取的列

vb程式設計,vb程式設計

private sub command1 click dim obj as object,mymouse as integer if list1.selcount 0 and list2.selcount 0 then for each obj in me.controlsif obj.name l...

vb程式設計題目,VB程式設計試題

您的第乙個問題 text1.text 輸入的數 就是 變數 在文字框裡不是什麼數都可以輸入麼?這就是常量啊!您的第二個問題 當然是寫50 應為val把50轉化了數值 為了方便你理解 我舉兩個例子吧 if val text1.text 60 thenprint pass else print nopa...

VB程式設計題目,VB程式設計題?

private sub form load text1.fontsize 10 end sub private sub command1 click text1.fontsize 10 int rnd 3 1 end sub private sub command2 click text1.font...

VB程式設計題,Vb程式設計題,

開頭你自己寫 中間過程是這樣的!int s,sum s 0 sum 0 for i 1 to 10 for j i 1 to 10 s j i next j end sum s sum next i end a 1 for i 1 to 10 a a i s s a next i label1.ca...

vb程式語言程式設計序問題),VB程式語言 程式設計序!!(3個問題)

三個問題才給10分,也太少了,呵呵 不過還是幫你解決一下。1 如下 private sub form load dim i as integer dim s,t as single dim n as integer show clss 0 t 1 n val inputbox 請輸入n的值 if n...