I am trying to find a value in a merge cell. So can then start processing the cells below it. Setting a Range and then using the Find method could not find the value.
Sorry – we don't have a ton of people here who do Excel programming. In general, most of us try to avoid it like the plague because it's so complicated and time-consuming. Give me a SQL Server database any day!
The excel spread is created by HR. I figure it out though. This is this a snippet. Also Get-filename is a function that open a windows so I can select the file. $excelsearchRange is how I was able to search for a value of a merge cell.
$objExcel= new-object -comobject excel.application
$filePath= Get-FileName "C:\Reports"
write-host "Processing File $filepath"
$arrayLHuser= New-Object System.Collections.ArrayList
Write-Host "Opening Workook"
$spreadsheet = $workbook.worksheets.item(1)
$excelSearchString = "NAMES TO BE ADDED TO NOTIFICATION PROGRAM"
(b)$excelSearchRange = $spreadsheet.range("A1").mergeArea(/b)
$search = $excelSearchRange.find($excelSearchString)
You must be logged in to reply to this topic.