自己寫的用過的vba

2021-05-27 07:50:19 字數 2046 閱讀 4692

藝思網   

sub 複製()

for i = 2 to 34

filecopy "d:\20110607\" & sheets("sheet3").cells(i, 1).text, "d:\" & sheets("sheet3").cells(i, 6).text

next i

end sub

sub 生成()

for i = 2 to 34

open "d:\20110607\" & sheets("sheet3").cells(i, 1).text for output as #1

close #1

next i

end sub

sub 生成資料夾()

on error resume next

for i = 2 to 34

mkdir "d:\" & sheets("sheet3").cells(i, 4).text

next i

end sub

'a = inputbox("請您輸入乙個數值")

msgbox "您輸入的數是" & a

end sub

sub fuzhi()

sheets("sheet1").cells(1, 1).value = "123456"

end sub

sub showmsg()

msgbox sheets("sheet1").cells(1, 1).text

end sub

sub copydata()

dim i

for i = 1 to 10

sheets("sheet1").cells(i, 2).value = sheets("sheet1").cells(i, 1).text

next i

end sub

sub checkdata()

dim scolno, dcolno, startcolno, colnum

dim snum, dnum

dim i, j, k, m

dim dcdata, scdata

scolno = inputbox("請輸入源資料起始列號")

snum = inputbox("請輸入源資料量")

dcolno = inputbox("請目標資料起始列號")

dnum = inputbox("請輸入目標資料量")

startcolno = inputbox("請複製資料起始列號")

colnum = inputbox("請複製資料列數")

scolno = cint(scolno)

snum = cint(snum)

dcolno = cint(dcolno)

dnum = cint(dnum)

startcolno = cint(startcolno)

colnum = cint(colnum)

k = 1

for i = 1 to dnum

dcdata = sheets("sheet1").cells(i, dcolno).text

'msgbox dcdata

for j = 1 to snum

scdata = sheets("sheet1").cells(j, scolno).text

if dcdata = scdata then

sheets("sheet1").cells(k, startcolno).value = dcdata

for m = 1 to colnum - 1

sheets("sheet1").cells(k, startcolno + m).value = sheets("sheet1").cells(j, scolno + m).text

next m

k = k + 1

end if

next j

sheets("sheet1").cells(i, scolno).value = sheets("sheet1").cells(i, 1).text

next i

end sub

給自己寫的

多吃些粗糧.給別人比他們自己期許的更多,並且用心去做 熟記你喜歡的詩歌 不要輕信你聽到的每件事,不要花光你的所有,不要想睡多久就睡多久。無論何時說 我愛你 請真心實意。無論何時說 對不起 請看著對方的眼睛。相信一見鐘情。永遠不要忽視別人的夢想。深情熱烈地愛,也許你會受傷,但這是使人生完整的唯一方法。...

自己寫的SQLHelper

using system using system.collections.generic using system.text using system.data.sqlclient using system.configuration using system.data namespace dal...

自己寫的alarm cond

include include errors.h include include typedef struct alarm tagalarm t alarm t alarm list null pthread mutex t mutex pthread mutex initializer pthre...