Forum Discussion
plotnik25
Nov 27, 2019Copper Contributor
Excel coordinats of cell midpoint
Hello, I would like to know, if it is possible to get the coordinates (x/y) of a certain cell in Excel, preferable using vba. Background: I want to center a form around the cell. Thank you for your ...
JKPieterse
Nov 27, 2019Silver Contributor
plotnik25 That is pretty complex. You can get close by getting the top and left and width and height of the cell, but those are relative to the top-left corner of the Excel application window whereas the top and left of a userform are relative to the top-left corner of the display. If accuracy is not important you could just add a fixed amount to cater for the ribbon's size and the window's border width. You'll have to multiply by points per pixel or vice versa as well. And if the Excel window has a split or frozen panes it will complicate matters even more 🙂