返回列表 上一主題 發帖

點選複製

回復 1# myleoyes
  1. Sub 多重分析()
  2.     Dim Rng As Range
  3.     With Sheet1
  4.         Set Rng = .Range("I2").CurrentRegion
  5.         Set Rng = .Range(Rng(2, 1), Rng(Rng.Count))
  6.         If Not Intersect(ActiveCell, Rng) Is Nothing Then
  7.             .[A2].Copy .Range("A" & Rows.Count).End(xlUp).Offset(1)
  8.             .Cells(ActiveCell.Row, "I").Resize(, 7).Copy .Range("I" & Rows.Count).End(xlUp).Offset(1)
  9.        End If
  10.     End With
  11. End Sub
複製代碼

TOP

回復 3# myleoyes
  1. Sub 多重分析()
  2.     ActiveWindow.ScrollRow = 150
  3.     Dim Rng As Range, E As Range
  4.     With Sheet1
  5.         Set Rng = .Range("I2").CurrentRegion
  6.         Set Rng = .Range(Rng(2, 1), Rng(Rng.Count))
  7.         For Each E In Selection.Rows
  8.             If Not Intersect(E, Rng) Is Nothing Then
  9.                 .[A2].Copy .Range("A" & Rows.Count).End(xlUp).Offset(1)
  10.                 .Cells(E.Row, "I").Resize(, 7).Copy .Range("I" & Rows.Count).End(xlUp).Offset(1)
  11.             End If
  12.         Next
  13.     End With
  14. End Sub
複製代碼
另 Hsieh 版主 的   r = Selection.Count   修改為 r = Selection.Rows.Count 才會正確的執行

TOP

回復 7# myleoyes
是這樣嗎?
  1. Sub 複製()
  2.     With Sheet1
  3.         .Range("B1", .[b1].End(xlDown).Offset(, 1)).Copy
  4.         With .[IV1].End(xlToLeft).Offset(, 1)
  5.             .PasteSpecial
  6.             .Resize(2, 2).Value = .Resize(2, 2).Value
  7.         End With
  8.     End With
  9. End Sub
複製代碼

TOP

回復 11# myleoyes
  1. Sub Ex()
  2.     Dim R As Range, Rng As Range
  3.     With ActiveSheet
  4.         For Each R In Selection
  5.             If Not Intersect(R, .Range(.[j2], .[j2].End(xlDown))) Is Nothing Then
  6.                 Set Rng = .Range("bs" & Rows.Count).End(xlUp).Offset(1)
  7.                 Rng.Value = ActiveSheet.[A2]
  8.                 Rng.Cells(1, 2) = R
  9.                 Range(R.Offset(, 2), .Cells(R.Row, "T")).SpecialCells(2).Copy Rng.Cells(1, 3)
  10.             End If
  11.         Next
  12.     End With
  13. End Sub
複製代碼

TOP

        靜思自在 : 愛不是要求對方,而是要由自身的付出。
返回列表 上一主題