- ©«¤l
- 1018
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 1058
- ÂI¦W
- 0
- §@·~¨t²Î
- win7 32bit
- ³nÅ骩¥»
- Office 2016 64-bit
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2012-5-9
- ³Ì«áµn¿ý
- 2022-9-28
|
¥»©«³Ì«á¥Ñ stillfish00 ©ó 2013-6-7 16:38 ½s¿è
¦^´_ 1# luke
¤gªk·Ò¿û¡A°Ñ¦Ò¬Ý¬Ý
¨ä¹ê¸ò¦³¨S¦³¦X¨ÖÄæ¦n¹³¨SÔ£Ãö«Y- Sub test()
- Dim r As Long, i As Long, ar
- Dim rngDelete As Range
-
- With Sheets("sheet1")
- '¥ý¾ã²zA~E
- r = Application.WorksheetFunction.Max( _
- .Cells(.Rows.Count, "A").End(xlUp).Row, _
- .Cells(.Rows.Count, "B").End(xlUp).Row, _
- .Cells(.Rows.Count, "E").End(xlUp).Row)
- With .Range("A1:E1").Resize(r)
- ar = .Value
- For i = 1 To UBound(ar)
- If ar(i, 1) = "" Then
- If rngDelete Is Nothing Then
- Set rngDelete = .Cells(i, 1).Resize(, .Columns.Count)
- Else
- Set rngDelete = Union(rngDelete, .Cells(i, 1).Resize(, .Columns.Count))
- End If
- End If
- Next
- If Not rngDelete Is Nothing Then
- rngDelete.Delete Shift:=xlUp
- Set rngDelete = Nothing
- End If
- End With
- '¦P¼Ë¨BÆJ¡A¾ã²zF~J
- r = Application.WorksheetFunction.Max( _
- .Cells(.Rows.Count, "F").End(xlUp).Row, _
- .Cells(.Rows.Count, "G").End(xlUp).Row, _
- .Cells(.Rows.Count, "J").End(xlUp).Row)
- With .Range("F1:J1").Resize(r)
- ar = .Value
- For i = 1 To UBound(ar)
- If ar(i, 1) = "" Then
- If rngDelete Is Nothing Then
- Set rngDelete = .Cells(i, 1).Resize(, .Columns.Count)
- Else
- Set rngDelete = Union(rngDelete, .Cells(i, 1).Resize(, .Columns.Count))
- End If
- End If
- Next
- If Not rngDelete Is Nothing Then
- rngDelete.Delete Shift:=xlUp
- Set rngDelete = Nothing
- End If
- End With
- End With
-
- End Sub
½Æ»s¥N½X |
|