Jump to content

How to convert from x y Excel coordinates R1C1 to A1 notation range?


Gianni
 Share

Recommended Posts

Hi
Does someone know if there is an easy way to convert numerical coordinates of row, column to an A1 notation range object (or at least to an A1 notation string)?
that is: if I have 2 numerical values for row and column, say row 3 and column 5, I would get an E3 string or better an $oRange object rappresenting that range (a single cell in this case)
Thanks on advance.

Edited by Chimp

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

Cells(Row,Column).Address 

EDIT

Excel udf has one to do it.

_Excel_ColumnToLetter

Saludos

Edited by Danyfirex
Edit
Link to comment
Share on other sites

I wrote this:

Func _GetNotation($oExcel,$iX,$iY)
    if IsObj($oExcel) Then
        Return StringReplace($oExcel.Cells($iX,$iY).Address,"$","")
    EndIf
EndFunc

Saludos

Link to comment
Share on other sites

Or use functions _Excel_ColumnToLetter and _Excel_ColumnToNumber.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

As I have dropped support for R1C1 notation in the new Excel UDF I had to provide such functions ;)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

As I have dropped support for R1C1 notation in the new Excel UDF I had to provide such functions ;)

Well done water!

... Also, about this subject, I would advise those who have to deal with excel's ranges, this nice tutorial, also by @water

https://www.autoitscript.com/wiki/Excel_Range

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...