Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Populate TextBox with cell reference when cell is clicked while UserForm is open

Tags:

excel

vba

I am working on a small VBA project, part of it is a userform.

One of the TextBoxes on the form requires the user to provide a cell reference

While the UserForm is open, if the TextBox is currently selected, and user clicks on a cell in the workbook, I'd like the TextBox to be populated with a reference to that cell.

(the same way as for example "New Formatting Rule: Use a formula to determine which cells to format" formula input is done)

Is there any way of solving this?

Important: the macro is not workbook specific, so I can't put anything in Workbook_Open event etc.

like image 997
LucasSeveryn Avatar asked Nov 27 '25 22:11

LucasSeveryn


1 Answers

There a control for this RefEdit available in the toolbox. Excellent article here to get you started ozgrid.com/Excel/free-training/ExcelVBA2/excelvba2lesson20.h‌​tm

like image 150
Nathan_Sav Avatar answered Nov 30 '25 21:11

Nathan_Sav



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!