Jump to content

creativewonders

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by creativewonders

  1. Sorry, but the whole code of my program is too long to show here... Here I extracted one example, but with this method I always found one value, but I need to find both and if it' s match the row number ... #include <MsgBoxConstants.au3> #include <FileConstants.au3> #include <Array.au3> #include <Excel.au3> Local $sValueToFind = "UC-R01/2" ; "C14416821" Local $sFileOpenDialog = @ScriptDir & "\sources\test.xlsm" If @error Then MsgBox($MB_SYSTEMMODAL, "", "No file(s) were selected.") ConsoleWrite($sFileOpenDialog & @CRLF) ShellExecute($sFileOpenDialog, "", "", "open", @SW_MAXIMIZE) If @error Then Exit MsgBox(0, "ERROR", "Error in ShellExecute") Local $aExcelFileName = StringRegExp($sFileOpenDialog, '[^\\]*$', 1) If Not IsArray($aExcelFileName) Then Exit MsgBox(0, "ERROR", "Error in StringRegExp" & @CRLF & "@error: " & @error) If Not WinWait($aExcelFileName[0], "", 15) Then Exit MsgBox(0, "ERROR", "Error in WinWait") Sleep(3000) Local $oWorkbook = ObjGet($sFileOpenDialog) If @error Or Not IsObj($oWorkbook) Then Exit MsgBox($MB_SYSTEMMODAL, "ERROR", "Error in ObjGet") Local $aResult = __Excel_RangeFind($oWorkbook, $sValueToFind) If Not @error And IsArray($aResult) Then _ArrayDisplay($aResult, "Excel UDF: _Excel_RangeFind Example", "", 0, "|", "Sheet|Cell|Value|Formula") Else Exit MsgBox(0, "Error", "The value/text (" & $sValueToFind & ") could not be found.") EndIf Func __Excel_RangeFind($oWorkbook, $sSearch, $vRange = Default, $iLookIn = Default, $iLookAt = Default, $bMatchcase = Default) If Not IsObj($oWorkbook) Or ObjName($oWorkbook, 1) <> "_Workbook" Then Return SetError(1, 0, 0) If StringStripWS($sSearch, 3) = "" Then Return SetError(2, 0, 0) If $iLookIn = Default Then $iLookIn = $xlValues If $iLookAt = Default Then $iLookAt = $xlPart If $bMatchcase = Default Then $bMatchcase = False Local $oMatch, $sFirst = "", $bSearchWorkbook = False, $oSheet If $vRange = Default Then $bSearchWorkbook = True $oSheet = $oWorkbook.Sheets(1) $vRange = $oSheet.UsedRange ElseIf IsString($vRange) Then $vRange = $oWorkbook.Activesheet.Range($vRange) If @error Then Return SetError(3, @error, 0) EndIf Local $aResult[100][4], $iIndex = 0, $iIndexSheets = 1, $iNumberOfSheets = $oWorkbook.Worksheets.Count While 1 $oMatch = $vRange.Find($sSearch, Default, $iLookIn, $iLookAt, Default, Default, $bMatchcase) If @error Then Return SetError(4, @error, 0) If IsObj($oMatch) Then $sFirst = $oMatch.Address While 1 $aResult[$iIndex][0] = $oMatch.Worksheet.Name $aResult[$iIndex][1] = $oMatch.Address $aResult[$iIndex][2] = $oMatch.Value $aResult[$iIndex][3] = $oMatch.Formula $iIndex = $iIndex + 1 If Mod($iIndex, 100) = 0 Then ReDim $aResult[UBound($aResult, 1) + 100][4] $oMatch = $vRange.Findnext($oMatch) If Not IsObj($oMatch) Or $sFirst = $oMatch.Address Then ExitLoop WEnd EndIf If Not $bSearchWorkbook Then ExitLoop $iIndexSheets = $iIndexSheets + 1 If $iIndexSheets > $iNumberOfSheets Then ExitLoop $sFirst = "" $oSheet = $oWorkbook.Sheets($iIndexSheets) If @error Then ExitLoop $vRange = $oSheet.UsedRange WEnd ReDim $aResult[$iIndex][4] Return $aResult EndFunc Exit
  2. I try everything but no result 😞
  3. Hi, I want to search for two Excel Cell Values ( Range A2:D25 ) - but I don' t know how ? 😞 Example: Values To Find : 'C14416821' in cell A2: A25 and 'UC-R01' in cell B2:B25 if both values match the result should be the address of the row. I hope it was not so complicated and you know what I mean πŸ™‚ Thanks in advance. test.xlsm
  4. Hey Water, I use it already, but donΒ΄t know the way of access the pst, make some changes and save the new entries... access pst access folder change or add foldername/subfolder
  5. Hi guys, I was trying to update an pst file in outlook - after creating different folders in outlook I want to update (change oder add folder/subfolder) to this pst file. How is the way to do that even it`s possible to do that?
Γ—
Γ—
  • Create New...