- Programming/[01] WSH

[VBS] 엑셀 병합해제한 쎌 동일 테이터로 채우기

n3015m 2014. 2. 7. 16:40
병합을 해제하면 첫줄 외에는 빈줄로 남게되는데 동일 테이터러 채워주는 스크립트다.

Sub 빈줄복사()


Dim sTmp

Dim sTmp2

Dim rCnt

Dim cCell

Dim eCell


eCell = InputBox("마지막줄 라인번호를 입력해 주세요!")

cCell = Selection.Column


For rCnt = 1 To eCell


    sTmp = ActiveSheet.Cells(rCnt, cCell).Value

    

    If sTmp = "" Then

        ActiveSheet.Cells(rCnt, cCell).Value = sTmp2

    Else

        sTmp2 = sTmp

    End If

Next


MsgBox ("Done.")

End Sub