나눔터  
  HOME > 나눔터 > 묻고답하기 > 엑셀
엑셀
엑셀에 대한 질문과 답변을 올려주세요. 단, 취지에 맞지 않는 글은 운영자가 삭제합니다.
 "000 님, 도와주세요", "부탁 드립니다.", "급합니다!" 등과 같이 막연한 제목을 달지 말아주세요.
[필독] 빠르고 정확한 답변을 얻는 16가지 Tip !
[필독] 저작권법 개정에 따른 이용안내
작성자:  

 미피 (mipisook)

추천:  2
파일:     조회:  2449
제목:   [RE]★ VBA 잘하시는분 좀 봐주세요?
     
 
수고하세용^^

Sub Working()
    Dim WS As Worksheet
    Dim R As Range
    Dim sName As String
    Dim sNextName As String
    Dim i As Integer
    Dim iRow As Integer
    
    Set R = Application.InputBox(Prompt:="시작셀 선택하십시오!", Title:="작업시작", Type:=8)
    Application.ScreenUpdating = False
    
    Set WS = Worksheets.Add
    If Not R Is Nothing Then
        
        Do
            sName = R
            sNextName = R.Offset(1, 0)
            
            i = i + 1
            iRow = iRow + 1
            With WS
                 .Cells(1 + iRow, 1) = R
                 .Cells(1 + iRow, 2) = R.Offset(0, 1)
                 .Cells(1 + iRow, 3) = R.Offset(0, 2)
            End With

            If sName <> sNextName And i < 5 Then
               Do
                  iRow = iRow + 1
                  WS.Cells(1 + iRow, 1) = R
                  i = i + 1
               Loop Until i = 5
            End If
            
            If i = 5 Then
                With WS.Range(WS.Cells(1 + iRow, 1), WS.Cells(1 + iRow, 3)).Borders(xlEdgeBottom)
                    .LineStyle = xlContinuous: .Weight = xlThin: .ColorIndex = xlAutomatic
                End With
                i = 0
            End If
            Set R = R.Offset(1, 0)

        Loop Until Len(R.Formula) = 0
        
        With WS.Range("A1:C1")
            .Value = Array("Name", "Idnum", "Cost")
            .Interior.ColorIndex = 15
            .Borders(xlEdgeBottom).LineStyle = xlDouble
            .Borders(xlEdgeBottom).Weight = xlThick
            .Borders(xlEdgeBottom).ColorIndex = xlAutomatic
        End With
    End If
    
End Sub
 
[불량 게시물 신고]  
        
  

작성일 : 2003-07-14(17:18)
최종수정일 : 2003-07-14(17:18)
 


 ◎ 관련글

  제 목   작성자   날짜
잘하시는분 좀 봐주세요? 이주경 2003-07-14
[RE]★ VBA 잘하시는분 좀 봐주세요? 미피 2003-07-14