Xytras1
asked on
Powershell with excel.
Looking to find a way to have powershell take everything in a Excel sheet and make it a table, with a table style of green. Any idea?
Your wording is ambiguous - do you want to
1. take some data from somewhere, and put it into Excel
2. take some Excel data, and want to format it as e.g. a HTML table?
1. take some data from somewhere, and put it into Excel
2. take some Excel data, and want to format it as e.g. a HTML table?
ASKER
I have data coming into Excel and I would like that data to be in a Table with a green style. Not sure if its possible .
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK where is what i would like the table to look like.
Capture.JPG
Capture.JPG
ASKER
Found it. Thanks for all the help.
Puts everything in WS to a Table.
#Create Table
$TableRange = $ws.Range("A1","H300")
$ws.ListObjects.Add([Micro soft.Offic e.Interop. Excel.XlLi stObjectSo urceType]: :xlSrcRang e, $xl.ActiveCell.CurrentRegi on, $null, [Microsoft.Office.Interop. Excel.XlYe sNoGuess]: :xlYes).Na me = "Table2"
$ws.ListObjects.Item("Tabl e2").Table Style = "TableStyleMedium2"
$TableRange.EntireColumn.A utofit()
Puts everything in WS to a Table.
#Create Table
$TableRange = $ws.Range("A1","H300")
$ws.ListObjects.Add([Micro
$ws.ListObjects.Item("Tabl
$TableRange.EntireColumn.A
I think you should just do that in Excel VBA (as a macro).
http://poshcode.org/1098
Open in new window