Vba写法:
split(cells(1,26).address,"$")(1) ‘26为你要转换为字母的数字
运行结果:
数字26对应的就是英文字母Z了
Powershell写法:
$xlapp = New-Object -ComObject "Excel.Application";
$xlapp.visible = $true;
$wb = $xlapp.workbooks.add();
$sht = $wb.worksheets.item(1);
$tempStr = $sht.cells(1,26).address();
Write-Host $tempStr.Substring($tempStr.IndexOf("$")+1,$tempStr.LastIndexOf("$")-1)
$sht = $null;
$wb = $null;
$xlapp.quit();
$xlapp = $null;
[GC]::Collect();
运行结果: