Excel VBA: How to Extend a Range Given a Current Selection
excel, selection, vba
Solution
Range(Cells(WorksheetFunction.Max(1, Selection.Row - 1), _
WorksheetFunction.Max(1, Selection.Column - 1)), _
Cells(WorksheetFunction.Min(Selection.Worksheet.Rows.Count, _
Selection.Row + 1), _
WorksheetFunction.Min(Selection.Worksheet.Columns.Count, _
Selection.Column + 1))).Select
upd: thanks Siddharth Rout for formating my msg
Problem
I want to do something like: ``` E18-(1,1) &":" &E18+(1,1) ``` My intent is to keep the selection of range `E18` (value = B) and extend the selection to `D16:F20`. If I have a cell's range of `E18` and I want to extend the range to `D16:F20`, how can I do this?