mehidy1437
Active Member
- Joined
- Nov 15, 2019
- Messages
- 348
- Office Version
- 365
- 2016
- 2013
- Platform
- Windows
- Mobile
- Web
Hi
If my selection range is a1: e5 then with below, we can have the first cell as fCell is a1, and last cell as lCell is e5.
But what if, i want to get the first column last cell as fColLastCell is a5, and last column first cell as lColFirstCell is e1?
Range can be vary time to time. Its not fixed.
How can I grab this in VBA?
If my selection range is a1: e5 then with below, we can have the first cell as fCell is a1, and last cell as lCell is e5.
But what if, i want to get the first column last cell as fColLastCell is a5, and last column first cell as lColFirstCell is e1?
Range can be vary time to time. Its not fixed.
How can I grab this in VBA?
VBA Code:
Set Rng = Selection
fCell = Rng.Cells(1).Value
lCell = Rng(Rng.count).Value
ACellAdd = ActiveCell.Address(0, 0)
lCellAdd = Rng(Rng.count).Address(0, 0)