Home > Software engineering >  Excel read line by line and save the problem
Excel read line by line and save the problem

Time:10-13

 Dim file2 As String 
Dim x1 As Excel. Application
Dim x1sheet As Excel. The Worksheet
Dim s (2 To 255) As String, y As String, I As an Integer

Y1=Mid (Combo1. List (Combo1. ListIndex), 1, 4)
M1=Mid (Combo2. List (Combo2. ListIndex), 1, 2)

If Combo1. List (Combo1. ListIndex)="" Or Combo2. List (Combo2. ListIndex)=" "Then
MsgBox "please select a date in" vbOKOnly, "note"
The Else
File1="e: \ xue " + + m1 (y1) + ". XLS "
File2="e: \ \ re of xue \ re" + + m1 (y1) + ". XLS "
End the If
Set the x1=CreateObject (" Excel. Application ")
X1. Workbooks. Open file1
The Set x1sheet=x1. Worksheets (1)
For I=2 To 255
S (I)=x1sheet. Cells (I, 2)
Y=TAX1 (s (I))
Next I
X1sheet. Cells (I, 2)=y
X1. ActiveWorkbook. SaveAs file2
X1. Workbooks. Close
X1. Quit
MsgBox "at the end of save,"

Do you want to be read excel table is the purpose of the second column of the data line by line, and then set into the tax1 get in a word, return to the original position, save,

CodePudding user response:

Trouble master, thank you

CodePudding user response:

Please help, thank you

CodePudding user response:

Write so much code, which other debugging has a problem? To the point!
  • Related