Thursday, September 26, 2019

excel - 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!

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...