본문 바로가기
카테고리 없음

엑셀에서 우편번호 검색하는 법

by gunhyuck 2007. 4. 4.

엑셀에서 우편번호를 검색하려면 우선 zipfinder라는 프로그램을 받아야 함니다

http://file.daum.net/view.php?fnum=61746<- 요기서 받으시면 되고요
 VBE를 실행시키고(단축키 Alt + F11)   모듈을 추가시킨 다음 모듈안에 아래의 코드를 복사해서 넣으세요

'파일오픈시 자동으로 오른쪽 마우스에 "우편번호 찾기"항목 추가

Sub Auto_Open()
On Error Resume Next

    Dim myBar As CommandBar
    Dim myButton1 As CommandBarControl

   
    Application.CommandBars("Cell").Reset
    Set myBar = Application.CommandBars("Cell")
    Set myButton1 = myBar.Controls.Add(Type:=msoControlButton, Before:=1)

    With myButton1
        .Caption = "우편번호찾기"
        .on-Action = "zipFinder"
        .Style = msoButtonIconAndCaption
        .FaceId = 140
    End With
   
End Sub

'우편번호찾기 프로그램 실행

Sub zipFinder()

    Shell "C:\Program Files\ZipFinder Enterprise\ZipFinder\zipfinder.exe", vbNormalFocus

End Sub



※ 프로그램이 실행이 안된다면, 바탕화면의 우편번호검색기의 속성을 보시면,

     파일의 경로가 나옵니다... 해당 프로그램의 위치로 바꾸어 주시면 됩니다...


그리고 아래의 내용은 ThisWorkBook에 추가하세요



'파일이 닫힐때 오른쪽마우스버튼 초기화


Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Application.CommandBars("Cell").Reset
End Sub


잘 되시길 바래요~