#SingleInstance
#NoEnv
Gui, Add, Button, x262 y25 w70 h20 gFilebtn, Browse
Gui, Add, text, x32 y29 w215 h40 vpathb,
Gui, Add, Edit, x32 y99 w75 h20 vedit1,
Gui, Add, Edit, x32 y129 w75 h20 vedit2,
Gui, Add, Edit, x32 y159 w75 h20 vedit3,
Gui, Add, Edit, x32 y189 w75 h20 vedit4,
Gui, Add, Edit, x32 y219 w75 h20 vedit5,
Gui, Add, Edit, x292 y99 w75 h20 vedit6,
Gui, Add, Edit, x292 y129 w75 h20 vedit7,
Gui, Add, Edit, x292 y159 w75 h20 vedit8,
Gui, Add, Edit, x292 y189 w75 h20 vedit9,
Gui, Add, Edit, x292 y219 w75 h20 vedit10,
Gui, Add, Text, x122 y102 w140 h20 vtext1,
Gui, Add, Text, x122 y132 w140 h20 vtext2,
Gui, Add, Text, x122 y162 w140 h20 vtext3,
Gui, Add, Text, x122 y192 w140 h20 vtext4,
Gui, Add, Text, x122 y222 w140 h20 vtext5,
Gui, Add, Text, x382 y102 w140 h20 vtext6,
Gui, Add, Text, x382 y132 w140 h20 vtext7,
Gui, Add, Text, x382 y162 w140 h20 vtext8,
Gui, Add, Text, x382 y192 w140 h20 vtext9,
Gui, Add, Text, x382 y222 w140 h20 vtext10,
Gui, Add, GroupBox, x20 y9 w330 h70 , 파일 선택(*.xlsx)
Gui, Add, GroupBox, x20 y79 w250 h170 ,
Gui, Add, GroupBox, x282 y79 w250 h170 ,
Gui, Add, Button, x72 y279 w60 h40 vStart gStart , 찾기
gui, font, s9
Gui, Add, Button, x182 y279 w60 h40 vSujung gSujung, 수정
Gui, Add, Button, x292 y279 w60 h40 vreset greset, 초기화
Gui, Add, Button, x412 y279 w60 h40 gclose, 종료
GuiControl,disable,Sujung,
; Generated using SmartGUI Creator 4.0
Gui, Show, x1244 y235 h379 w550, Excel_문자열찾기_0.3v
Return
GuiClose:
Ex.Quit
ExitApp
Filebtn:
fileselectfile, path ;### path변수에 파일경로저장.
Gui,Submit,nohide
Guicontrol,,pathb, %path%
return
Start:
Gui,Submit,nohide
if (path!="")
{
GuiControl,Disable,edit1,
GuiControl,Disable,edit2,
GuiControl,Disable,edit3,
GuiControl,Disable,edit4,
GuiControl,Disable,edit5,
GuiControl,Disable,edit6,
GuiControl,Disable,edit7,
GuiControl,Disable,edit8,
GuiControl,Disable,edit9,
GuiControl,Disable,edit10,
GuiControl,Disable,Start,
GuiControl,Enable,Sujung,
Ex := ComObjCreate("Excel.Application")
Ex := ComObjActive("Excel.Application")
Ex.workbooks.open(path) ;### path변수에있는 경로 열기
Ex.visible := True ;### 엑셀파일 보이기
amount_of_sheets:=Ex.worksheets.count
a=1
b=1
Loop 9
{
someedit:=edit%a%
sometext=text%b%
if(someedit!="")
Loop %amount_of_sheets%
{
Ex.worksheets(A_index).Select
result:=Ex.worksheets(A_index).range("1:1000").Find(someedit)
first:=result.Address
if (first!="")
{
GuiControl,,%sometext%, %A_index%번째 시트의 %first% 셀
Ex.worksheets(A_index).range(first).Interior.ColorIndex := 29 ; 찾은 셀의 색을 29(보라)로 설정
Loop
{
result:=Ex.worksheets(A_index).range("1:1000").FindNext(result)
next:=result.Address
msgbox, %next%
if (next == first) ;지금 찾는 값과 전에 찾은 주소를 비교
{
break
}
else
{
GuiControl,,%sometext%, %A_index%번째 시트의 %next% 셀
Ex.worksheets(A_index).range(next).Interior.ColorIndex := 29
}
} ;Loop 끝나는 부분
if(sometext!="") ;만약에 찾은 값이 없어서 guicontrol이 안됐을 경우
{
GuiControl,,%sometext%, 없는데요 ㅡㅡ?
}
} ;if(first!="") 마치는부분
else
{
}
}
a:=a+1
b:=b+1
}
}
else
{
msgbox, 경로를 설정해주세요.
}
return
Sujung:
Ex.Quit
GuiControl,Disable,Sujung,
GuiControl,Enable,edit1,
GuiControl,Enable,edit2,
GuiControl,Enable,edit3,
GuiControl,Enable,edit4,
GuiControl,Enable,edit5,
GuiControl,Enable,edit6,
GuiControl,Enable,edit7,
GuiControl,Enable,edit8,
GuiControl,Enable,edit9,
GuiControl,Enable,edit10,
sleep, 5000
GuiControl,Enable,Start,
return
reset:
Ex.Quit
GuiControl,Enable,Start,
GuiControl,Disable,Sujung,
GuiControl,,text1,
GuiControl,,text2,
GuiControl,,text3,
GuiControl,,text4,
GuiControl,,text5,
GuiControl,,text6,
GuiControl,,text7,
GuiControl,,text8,
GuiControl,,text9,
GuiControl,,text10,
GuiControl,,edit1,
GuiControl,,edit2,
GuiControl,,edit3,
GuiControl,,edit4,
GuiControl,,edit5,
GuiControl,,edit6,
GuiControl,,edit7,
GuiControl,,edit8,
GuiControl,,edit9,
GuiControl,,edit10,
GuiControl,Enable,edit1,
GuiControl,Enable,edit2,
GuiControl,Enable,edit3,
GuiControl,Enable,edit4,
GuiControl,Enable,edit5,
GuiControl,Enable,edit6,
GuiControl,Enable,edit7,
GuiControl,Enable,edit8,
GuiControl,Enable,edit9,
GuiControl,Enable,edit10,
return
close:
Ex.Quit
ExitApp
'오토핫키' 카테고리의 다른 글
법정의무교육 자료 (0) | 2017.12.11 |
---|---|
오토핫키 학습에 유용한 티스토리들 (0) | 2017.12.04 |
뿔레전쟁 (0) | 2017.10.19 |
오토핫키로 IP, 서브넷마스크, 게이트웨이, DNS 변경하고, 배치파일로 만들기 (3) | 2017.10.16 |
오토핫키로 엑셀에서 내용 찾고 색 채우기 (0) | 2017.09.29 |