Comments (3)
1..60 | Get-ExcelColumnName
ColumnNumber ColumnName
------------ ----------
1 A
2 B
3 C
4 D
5 E
6 F
7 G
8 H
9 I
10 J
11 K
12 L
13 M
14 N
15 O
16 P
17 Q
18 R
19 S
20 T
21 U
22 V
23 W
24 X
25 Y
26 Z
27 AA
28 AB
29 AC
30 AD
31 AE
32 AF
33 AG
34 AH
35 AI
36 AJ
37 AK
38 AL
39 AM
40 AN
41 AO
42 AP
43 AQ
44 AR
45 AS
46 AT
47 AU
48 AV
49 AW
50 AX
51 AY
52 AZ
53 BA
54 BB
55 BC
56 BD
57 BE
58 BF
59 BG
60 BH
from importexcel.
I created a hash table:
# ImportExcel
$global:EndColumn = [ordered]@{
1 = "A" 2 = "B" 3 = "C" 4 = "D" 5 = "E" 6 = "F" 7 = "G" 8 = "H" 9 = "I" 10 = "J" 11 = "K" 12 = "L" 13 = "M" 14 = "N" 15 = "O" 16 = "P" 17 = "Q" 18 = "R" 19 = "S" 20 = "T" 21 = "U" 22 = "V" 23 = "W" 24 = "X" 25 = "Y" 26 = "Z" 27 = "AA" 28 = "AB" 29 = "AC" 30 = "AD" 31 = "AE" 32 = "AF" 33 = "AG" 34 = "AH" 35 = "AI" 36 = "AJ" 37 = "AK" 38 = "AL" 39 = "AM" 40 = "AN" 41 = "AO" 42 = "AP" 43 = "AQ" 44 = "AR" 45 = "AS" 46 = "AT" 47 = "AU" 48 = "AV" 49 = "AW" 50 = "AX" 51 = "AY" 52 = "AZ" 53 = "BA" 54 = "BB" 55 = "BC" 56 = "BD" 57 = "BE" 58 = "BF" 59 = "BG" 60 = "BH"
}
$Count = $WorkSheet.Dimension.End.Column
Set-Format -Address $WorkSheet.Cells["A1:$($EndColumn.$Count)1"] -BackgroundColor $BackgroundColor -FontColor Black
Works for me, but I don't know if there is an easier way.
from importexcel.
Thank you!
from importexcel.
Related Issues (20)
- Issue with empty values in generated Excel. HOT 1
- Issue with user-defined number format HOT 5
- Export-Excel's -CellStyleSB switch doesn't seem to parse dimensions.address correctly for use with Set-CellStyle HOT 2
- Can't get 'Close-ExcelPackage' to work properly HOT 5
- Exporting hashtable to new (empty) file doesn't transfer as expected HOT 4
- Exporting with default theme now renders as purple after recent office update? HOT 11
- New-ConditionalText Question HOT 1
- Exporting worksheet to csv while keeping excel formats (where applicable) HOT 9
- Set-ExcelRange -Formula issue HOT 1
- KillExcel fails
- Feature Request: Set the default worksheet when the workbook is opened HOT 3
- Close-ExcelPackage -Show broken on MacOS due to PowerShell issue HOT 1
- Add -Calculate to Open-ExcelPackage and Import-Excel
- Export-Excel -Style work wrong with multiple sheets HOT 4
- Help with getting a Table without Headers HOT 6
- Exception calling "Save" with "0" argument(s) HOT 3
- Faulty Hyperlink to web site using OfficeOpenXml.ExcelHyperLink HOT 2
- Question: How to match a keyword (stored in a variable) in a specific column and color a range? HOT 2
- Formatting OutPut HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from importexcel.