標題:
[發問]
找不出問題? 請指點一下
[打印本頁]
作者:
jakcy1234
時間:
2013-9-17 21:11
標題:
找不出問題? 請指點一下
Sub Macro1()
Set sht1 = Sheets("Sheet1")
Set sht2 = Sheets("Sheet2")
Set sht3 = Sheets("Sheet3")
LastRow = sht1.Cells(sht1.Rows.Count, 1).End(xlUp).Row
For rw = 2 To LastRow
With Sheets("Sheet2")
Range("A1").Copy
End With
sht1.Cells(rw, 1).Copy
Sheets("Sheet2").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
With Sheets("Sheet3")
Sheets("Sheet3").Select
selectend = Cells(1, Columns.Count).End(xlToLeft).Column
Range("A1", Cells(1, selectend)).Copy
LR = .Cells(.Rows.Count, 1).End(xlUp).Row
Cells(LR, 1).Offset(1, 0).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
If Cells(LR, 1).Offset(0, 0).Value = 0 Then ''''''''''''' ( value = 0 ) 就 delete
Cells(LR, 1).EntireRow.Delete ''''''''''''' ( value = 0 ) 就 delete
End If
End With
Next
End Sub
複製代碼
[attach]16093[/attach]
我設了一個方法 如果 ( value = 0 ) 就 delete, 但為什麼最後的一個 0 delete 不到 ????
作者:
sunnyso
時間:
2013-9-18 22:12
for lastrow to 2 step -1
歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)