Excel: how to get current cell's address
Thread poster: Samuel Murray
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 08:29
Member (2006)
English to Afrikaans
+ ...
Oct 18, 2021

Hello everyone

Is there a function or functionality in Excel (latest version) that will get me the current cell's address? I mean, if I click a cell (say, A22), and press a shortcut or use a menu, I want "A22" to be added to the clipboard. Does anyone know how to accomplish this?

Thanks
Samuel


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 08:29
Member (2006)
English to Afrikaans
+ ...
TOPIC STARTER
One solution Oct 18, 2021

The first solution that I found (which is a manual process, but you can do it using just the keyboard), is this:
1. Right-click the cell, and press "a" (Define name).
2. Press Alt+R (this selects the text in "Refers to").
3. Press Ctrl+C to copy, and convert the content to a cell address. E.g. if the worksheet is named "Hello", then you'd get "=Hello!$A$22", which is A22.


 
Joakim Braun
Joakim Braun  Identity Verified
Sweden
Local time: 08:29
German to Swedish
+ ...
VB script Oct 18, 2021

https://stackoverflow.com/questions/2202093/get-the-current-cell-in-excel-vb/42361786
https://www.wallstreetmojo.com/vba-active-cell/
... See more
https://stackoverflow.com/questions/2202093/get-the-current-cell-in-excel-vb/42361786
https://www.wallstreetmojo.com/vba-active-cell/
https://www.excelcampus.com/vba/keyboard-shortcut-run-macro/

Write a macro (VB script) and set a shortcut for it.
It's three lines of code or so.
Collapse


 
Endre Both
Endre Both  Identity Verified
Germany
Local time: 08:29
English to German
Autohotkey Oct 19, 2021

Hi Samuel, you have been using AutoHotkey in the past, right? Here's a snippet that copies the current cell reference to the clipboard when you press Alt+F1:

!F1::
    xl := ComObjActive("Excel.Application")
    currentCellRef := xl.ActiveCell.Address ; e.g. $A$1
    currentCellRef := RegExReplace(currentCellRef, "\$", "") ; $A$1 -> A1
    Clipboard := currentCellRef
return


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 08:29
Member (2006)
English to Afrikaans
+ ...
TOPIC STARTER
Thanks, everyone Oct 19, 2021

Thanks for your ideas. I may try them out in a future job. I had to complete the current job in record time. It involved pasting the translation of e.g. cell AAA21 into e.g. cell AAF21 etc. I copied all cells to Word, converted them to a plain text list, and then translated them, and then copy/pasted the translations into the appropriate cells in Excel. Being able to tell my script what a cell's address is helped me for instances where the "translation" cells were not in predictable locatio... See more
Thanks for your ideas. I may try them out in a future job. I had to complete the current job in record time. It involved pasting the translation of e.g. cell AAA21 into e.g. cell AAF21 etc. I copied all cells to Word, converted them to a plain text list, and then translated them, and then copy/pasted the translations into the appropriate cells in Excel. Being able to tell my script what a cell's address is helped me for instances where the "translation" cells were not in predictable locations.Collapse


 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

Excel: how to get current cell's address






TM-Town
Manage your TMs and Terms ... and boost your translation business

Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.

More info »
CafeTran Espresso
You've never met a CAT tool this clever!

Translate faster & easier, using a sophisticated CAT tool built by a translator / developer. Accept jobs from clients who use Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

Buy now! »