Public Function PrintLog(path As String)
Open path For Append As #1
'ActiveSheet.UsedRange.Rows.Count表示sheet中的行数
sheet.rows = ActiveSheet.UsedRange.Rows.Count
'ActiveSheet.UsedRange.Columns.Count表示sheet中的列数
sheet.cloumns = ActiveSheet.UsedRange.Columns.Count
For i = 2 To SheetInfo.Rows
For j = 3 To SheetInfo.Cloumns
If ("" <> Cells(i, j).Value) Then
Print #1, Cells(i, j) + ",";
End If
Next j
Next i
Close #1
End Function
<> : 等同于!=
For循环格式:
For i = 1 To NumMax
Next i
If条件判断:
If () Then
Else
End if