ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¤W¤U­È¤£¦P´¡¤JªÅ¥Õ¾ã¦æ,½Ð°Ý¦p¦ó§ï´¡¤JÀx¦s®æ

[µo°Ý] ¤W¤U­È¤£¦P´¡¤JªÅ¥Õ¾ã¦æ,½Ð°Ý¦p¦ó§ï´¡¤JÀx¦s®æ

Sub insertRow()
' insertRow Macro
' §»¥Ñ mike ¿ý»s¡A®É¶¡: 2012-8-6
' §Ö±¶Áä: Ctrl+u
    Dim RowN As Integer
    Dim i As Integer, j As Integer
        j = 6 '
        X = Cells(ActiveSheet.Rows.Count, 6).End(xlUp).Row
    For i = 1 To X      '§P©w«DªÅªº³Ì¤j¦æ¼ÆRowN
         If Cells(i, j).Value <> "" Then
            RowN = i
           
         End If
    Next i
    For i = RowN To 3 Step -1
       If Cells(i, j) <> "" And (Cells(i, j) <> Cells(i - 1, j)) And Cells(i - 1, j) <> "" Then
       Rows(i).Select
       Selection.Insert Shift:=xlDown
       End If
    Next i
End Sub

·Q§ï¬°¥u´¡¤JA~Jªº¦æ,¤£­n´¡¤J¾ã¦æ

TOP

¥»©«³Ì«á¥Ñ starry1314 ©ó 2016-7-21 16:26 ½s¿è

¦^´_ 2# starry1314

¤w­×§ï¦¨¥\,·Q½Ð°Ý¦p¦ó¨Ï¥Î 10 step


1.·Q½Ð°Ý¦p¦ó¨Ï¥Îsql¨Ó°µ³B²z,¦]¬°³o¼Ë´¡¤J«á·|¾É­P¤½¦¡¦Û°Ê§ó·s
   ·Q§ï¥Î³B²z§¹¤§«á¶K¤W
  1. Sub insertRow´ö()
  2. ' insertRow Macro
  3. ' §»¥Ñ mike ¿ý»s¡A®É¶¡: 2012-8-6
  4. ' §Ö±¶Áä: Ctrl+u
  5.     Dim RowN As Integer
  6.     Dim i As Integer, j As Integer
  7.         j = 6 '
  8.         X = Cells(ActiveSheet.Rows.Count, 6).End(xlUp).Row
  9.     For i = 1 To X      '§P©w«DªÅªº³Ì¤j¦æ¼ÆRowN
  10.          If Cells(i, j).Value <> "" Then
  11.             RowN = i
  12.            
  13.          End If
  14.     Next i
  15.     For i = RowN To 3 Step -1
  16.        If Cells(i, j) <> "" And (Cells(i, j) <> Cells(i - 1, j)) And Cells(i - 1, j) <> "" Then
  17.        'Range.("A" & i &":J"&i).Select
  18.        Range(Cells(i, 1), Cells(i, 10)).Select
  19.        Selection.Insert Shift:=xlDown
  20.        End If
  21.     Next i
  22. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¦³¤ß´N¦³ºÖ¡A¦³Ä@´N¦³¤O¡A¦Û³yºÖ¥Ð¡A¦Û±oºÖ½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD