Skip to content

Empty cells in a column #1375

Answered by mezamoe
mezamoe asked this question in Q&A
Discussion options

You must be logged in to vote

found that too, sorry for the waste of time.. hopefully it might help other importExcel newbies:

$excelPack = Open-ExcelPackage -Path 'pathToFile'
$worksheet = $excelPack.Workbook.Worksheets['sapsid']
foreach ($cell in ($worksheet.SelectedRange["D2:D"])){
$cell.Clear()
}
$count = 1
foreach($item in $servers){
$count +=1
$worksheet.Cells["D$count"].Value = $item
}
Close-ExcelPackage $excelPack

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by dfinke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants