循环语句解释Private Sub CommandButton1_Click() Dim icell,x,m,y As Integer Dim CELL,CELLT,CELLR As String x = 0 CELLT = "" CELL = "" CELLR = "" y = 1Sheets("Sheet2").Select Sheet2.Cells.Select Selection.ClearContents Sheets("Sheet1").Selectm = 1
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/25 20:26:07
循环语句解释Private Sub CommandButton1_Click() Dim icell,x,m,y As Integer Dim CELL,CELLT,CELLR As String x = 0 CELLT = "" CELL = "" CELLR = "" y = 1Sheets("Sheet2").Select Sheet2.Cells.Select Selection.ClearContents Sheets("Sheet1").Selectm = 1
循环语句解释
Private Sub CommandButton1_Click() Dim icell,x,m,y As Integer Dim CELL,CELLT,CELLR As String x = 0 CELLT = "" CELL = "" CELLR = "" y = 1
Sheets("Sheet2").Select Sheet2.Cells.Select Selection.ClearContents Sheets("Sheet1").Select
m = 1 Do Until Sheet1.Cells(m,1).Value = "" m = m + 1 x = x + 1 Loop Sheet2.Cells(1,1).Value = "CELL" Sheet2.Cells(1,2).Value = "CELLR" For icell = 2 To m
CELLT = Sheet1.Cells(icell,1).Value
If CELL = "" Then CELL = CELLT CELLR = Trim(Sheet1.Cells(icell,2).Value) ElseIf CELLT CELL Then y = y + 1 Sheet2.Cells(y,1).Value = CELL Sheet2.Cells(y,2).Value = CELLR CELL = CELLT CELLR = Trim(Sheet1.Cells(icell,2).Value) ElseIf CELLT = CELL Then CELLR = Trim(CELLR) & " " & Sheet1.Cells(icell,2).Value ElseIf CELLT = "" Then y = y + 1 Sheet2.Cells(y,1).Value = CELL Sheet2.Cells(y,2).Value = CELLR End If Next End Sub
循环语句解释Private Sub CommandButton1_Click() Dim icell,x,m,y As Integer Dim CELL,CELLT,CELLR As String x = 0 CELLT = "" CELL = "" CELLR = "" y = 1Sheets("Sheet2").Select Sheet2.Cells.Select Selection.ClearContents Sheets("Sheet1").Selectm = 1
VB的 Excel 操作?代码很乱哎~sheet1 copy到 sheet2?