首先需要知道你要引用的数据在Excel中的位置,然后在VB里面引用Excel,然后打开Excel文件读数据Dim scxls As Excel.ApplicationDim scbook As Excel.WorkbookDim scsheet As Excel.Worksheet‘Set scxls = CreateObject("excel.application")‘Set scbook = scxls.Workbooks.AddSet scbook = scxls.Workbooks.open("c:1.xls"
)Set scsheet = scbook.Worksheets(1)‘scsheet.Cells(1, 2) = "1111" ’写入数据a=scsheet.Cells(1, 2) '读取数据Set scbook = NothingSet scxls = Nothing‘scxls.Visible = True ’显示Excle数据较多,且有规律可循时,请使用循环语句