M
MSweetG222
I am trying to determine the cell address of the cell in the lower right
corner of the selected range. I tried the code from David McRitchie's
website (modified slightly, I changed code from denoted address on the
spreadsheet to displaying address in a msgbox). The code works okay in Excel
2003, but when selecting a larger region in Excel 2007, I receive an overflow
issue.
Assume the range selected is A:FFF
Sub MarkSepAreas()
'David McRitchie 1999-06-03 Mark cells with cell address and
'area number. Enhanced based on Alan Beban code 1999-06-03.
'Documented with Join()
'in http://www.mvps.org/dmcritchie/excel/join.htm
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim i As Long, j As Long
For i = 1 To Selection.Areas.Count
For j = 1 To Selection.Areas(i).Count
x = Selection.Areas(i)(j).AddressLocal(0, 0)
MsgBox x
Next
Next
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
corner of the selected range. I tried the code from David McRitchie's
website (modified slightly, I changed code from denoted address on the
spreadsheet to displaying address in a msgbox). The code works okay in Excel
2003, but when selecting a larger region in Excel 2007, I receive an overflow
issue.
Assume the range selected is A:FFF
Sub MarkSepAreas()
'David McRitchie 1999-06-03 Mark cells with cell address and
'area number. Enhanced based on Alan Beban code 1999-06-03.
'Documented with Join()
'in http://www.mvps.org/dmcritchie/excel/join.htm
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim i As Long, j As Long
For i = 1 To Selection.Areas.Count
For j = 1 To Selection.Areas(i).Count
x = Selection.Areas(i)(j).AddressLocal(0, 0)
MsgBox x
Next
Next
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub