I have an Excel spreadsheet with the text "Hello, this is a long line of text" in cell A1. I have selected cells A1:G1.
I know if I use the line Selection.HorizontalAlignment = xlCenterAcrossSelection
in a macro, it will format the selected cells using the horizontal text alignment option "Center across Selection".
How can I write a function that will do the inverse operation, i.e. given cell A1, return the range A1:G1 ?