vendredi 27 février 2015

How to get the range of selected cells using VBA?

I'm trying to write an Excel Macro using VBA. The problem is, the cells processed in this macro are selected by user, so I can't predefine the range.


Here is my code:



Range(???).Select
Selection.FormulaR1C1 = StrConv(Selection.Text, 3)


How do I take the range of selected cells to fill in "???" in the code above?


n.b.: User can select any range they want, and they can use this macro more than once.


Thanks in advance!


Aucun commentaire:

Enregistrer un commentaire