Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `
- $ExportFile = "I:SCRIPTIPCNewScriptResult.csv"
- $xlShiftDown = -4121
- $objExcel=New-Object -ComObject Excel.Application
- #$objExcel.Visible=$true
- $objExcel.DisplayAlerts = FALSE
- $WorkBook=$objExcel.Workbooks.Open($ExportFile)
- $worksheet = $workbook.sheets.item("Result")
- #Get row & column count
- $objRange = $worksheet.UsedRange
- $RowCount = $objRange.Rows.Count
- $ColumnCount = $objRange.Columns.Count
- for ( $i=3 ; $i -le 4; $i ++ ){
- $inc = 1
- $NexRow = $i + $inc
- for ( $j=1 ; $j -le 3; $j ++ ){
- $worksheet.Cells.Item($i,$j).Text
- $worksheet.Cells.Item($NexRow,$j).Text
- $MergeCells = $worksheet.Range($worksheet.Cells.Item($i,$j), $worksheet.Cells.Item($NexRow,$j))
- $MergeCells.Select()
- $MergeCells.MergeCells = $true
- $MergeCells.Font.ColorIndex = 11
- #$objRange.EntireColumn.AutoFit() | Out-Null
- }
- }
- $WorkBook.Save()
- $objExcel.Quit()
- `
Add Comment
Please, Sign In to add comment