#include #include #include #include #include #Region ### START Koda GUI section ### $UIC = GUICreate("Test Case Cleaner", 220, 150, 300, 200) ;Group & Buttons $FindReplace = GUICtrlCreateButton ("Find Replace", 60, 100, 100, 20, 1) $LowValueLabel = GUICtrlCreateLabel ("Low Value", 40, 20, 60, 20) $LowValue = GUICtrlCreateInput ("", 40, 40, 60, 20) $HighValueLabel = GUICtrlCreateLabel ("High Value", 120, 20, 60, 20) $HighValue = GUICtrlCreateInput ("", 120, 40, 60, 20) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg ;Console Login Case $FindReplace ;Open excel and navigate to find and replace WinActivate ( "Microsoft Excel", "") Send("{CTRLDOWN}f{CTRLUP}") Sleep(100) Send("{ALTDOWN}p{ALTUP}") Sleep(100) ;Clear any old values that may have been previously established. ControlClick ( "Find and Replace", "", 18, "") ControlSetText ( "Find and Replace", "", 18, "") Sleep(100) ControlClick ( "Find and Replace", "", 21, "") ControlSetText ( "Find and Replace", "", 21, "") Sleep(100) ;Get The Low value from the GUI and assign it to the Find What value in Excel $GetLowValue = GUICtrlRead ($LowValue) ControlSetText ("Find and Replace", "", 18, $GetLowValue) ;Parse through low to high values. ;Stop parsing if excel cannot find a match or excel cannot find any data to replace when clicking Replace All. Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd