Excell - Letter of Column

Hi everybody,

I hope you can help me.

I’d like to get the Letter of an column in an Excel-Sheet.

Exemple:



set poCount to 0

tell application "Microsoft Excel"
	
	set ur to used range of active sheet
	set theColumns to count columns of ur
	-- the result of the variable theColumns is 63
	
end tell

poCount


Now how I get the Letter of the Column 63?

Thanks for your help!

Cheers
Marth

Perhaps something like this

tell application "Microsoft Excel"
	set columnNumber to 63
	
	set tid to AppleScript's text item delimiters
	set AppleScript's text item delimiters to {":"}
	set columnLetters to text item 1 of (get address of (column columnNumber) without column absolute)
	set AppleScript's text item delimiters to tid
	return columnLetters -- "BK"
end tell

But I’d bet you don’t need the letters. Cells can be referenced with numbers

tell application "Microsoft Excel"
	set myRange to row 3 of column 5
	get address myRange -- $E$3
end tell

Also, one should note that the Used Range does not nessesarily start in column A.

Hi mikerickson,

Thank you very much for your help! It works great! :smiley:

Cheers,

Marth