OaklandJim
Well-known Member
- Joined
- Nov 29, 2018
- Messages
- 855
- Office Version
- 365
- Platform
- Windows
I am trying to use .CurrentRegion with a range object with one cell, in this case cell D2. I confirm that the range object -- rAnchorCellChartData -- is set with Debug.Print as shown below. When trying to get the current region with that range object (rAnchorCellChartData.CurrentRegion) the result is the range with one cell. If I activate the same cell then .CurrentRegion returns the correct range when used with ActiveCell (ActiveCell.CurrentRegion).
I must be missing something basic?
Result
rAnchorCellChartData = $D$2
rAnchorCellChartData.CurrentRegion = $D$2
ActiveCell = $D$2
ActiveCell.CurrentRegion = $C$1:$I$3
I must be missing something basic?
VBA Code:
Debug.Print "rAnchorCellChartData = " & rAnchorCellChartData.Address
Debug.Print "rAnchorCellChartData.CurrentRegion = " & rAnchorCellChartData.CurrentRegion.Address
Debug.Print "ActiveCell = " & ActiveCell.Address
Debug.Print "ActiveCell.CurrentRegion = " & ActiveCell.CurrentRegion.Address
Result
rAnchorCellChartData = $D$2
rAnchorCellChartData.CurrentRegion = $D$2
ActiveCell = $D$2
ActiveCell.CurrentRegion = $C$1:$I$3