Private Sub Workbook_Open()
Dim i, j As Integer
Dim a, b As String
Sheets.Add
Sheet1.Select
For i = 3 To 150
If Application.WorksheetFunction.CountA(Rows(i)) = 0 Then
i = i + 1
Else
If Cells(i, 10) <> "=" Then
For j = 1 To 10
If Cells(i, j) <> "" Then
a = Trim(Cells(i, j) & Cells(i, j))
Sheets.Cells(i, 2) = a ''我本来想把内容复制到新增的工作薄中去
End If
Next j
End If
End Sub
要怎么修改???作者: pureshadow 时间: 2008-11-10 14:53
Selection.Copy
Workbooks.Add
ActiveSheet.Paste作者: 方漠 时间: 2008-11-10 15:18
试试用个变量传递一下.
Dim a, b As String
Dim SH as String
Sheets.Add
SH=ActiveSheet.Name
Sheet1.Select
...........
Sheets(SH).Cells(i, 2) = a