Sub 일련번호표시()
'
' 일련번호표시 매크로
'

'--------코드추가 시작----------
    Dim 행수 As Integer
    
    행수 = Range("A7").CurrentRegion.Rows.Count
        
    If 행수 = 1 Then
        Exit Sub
    ElseIf 행수 = 2 Then
        Range("A8").Value = 1
        Exit Sub
    End If
'--------코드추가 끝----------

    Range("A8").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.FormulaR1C1 = "=ROW()-7"
    Range("A1").Select
End Sub




Sub 데이터지우기()
'
' 데이터지우기 매크로
'
'--------코드추가 시작----------
    
    Dim 행수 As Integer
        
    행수 = Range("A7").CurrentRegion.Rows.Count
    
    Range("A8").Select
    
    If 행수 = 1 Then
        Exit Sub
    ElseIf 행수 > 2 Then
        Range(Selection, Selection.End(xlDown)).Select
    End If
'--------코드추가 끝----------
    
' ---------------코드 삭제 시작--------------
    'Range("A8").Select
    'Range(Selection, Selection.End(xlDown)).Select
' --------------코드 삭제 끝 --------------
    
    Range(Selection, Selection.End(xlToRight)).Select
    Selection.Clear
      
    Range("A1").Select
    
End Sub