I have a Script that took the Column number($lc) and Row Number ($sr / $lr).
Now I'd like to select a Range from ($lc - 7)($sr) to ($lc)($lr).
The problem is, I don't know how to convert a Column Number into a letter. OR How can I address a Range by using the Number?
$file = "C:\Test\Excel_Matrix.xlsx"
#Program definieren
$excel = New-Object -ComObject Excel.Application
#im hintergrund ausführen
$excel.visible = $false
$table = $null
$workbook = $excel.workbooks.open($file)
$table = $workbook.Worksheets.Item("Matrix")
###########
#Basisdaten
###########
$table = $null
$workbook = $excel.workbooks.open($file)
$table = $workbook.Worksheets.Item("Matrix")
IF($table -ne $null)
{
#Last Row lr
$LetzteZeile = $table.Range("A10:A1000").Find("S999").row
# start row sr
$StartZeile = $table.Range("A10:A1000").Find("S002").row
# last column lc
$LetzteSpalte = $table.UsedRange.Find($LastText).Column
$StartZeile
$LetzteZeile
**### DON'T WORK ###**
$table.Range(.Cells($StartZeile,1),.Cells($LetzteZeile,$LetzteSpalte)
}
$workbook.Close()
$excel.Quit()
$excel = $null
Thanks for your time.
$table.Range($table.Cells($Step.Row, 6),$table.Cells($Step.Row, ($LetzteSpalte-9)))AND$table.Range($table.Cells.Item($Step.Row, 6).FormulaR1C1,$table.Cells.Item($Step.Row, ($LetzteSpalte-9)).FormulaR1C1)But it Don't works...