OaklandJim
Well-known Member
- Joined
- Nov 29, 2018
- Messages
- 833
- Office Version
- 365
- Platform
- Windows
I am doing a super basic For Loop through a range of numeric values. I did do Format Cells => Number, no decimal points to make sure that the values are numbers. When I Debug.Print the numbers there are question marks after the numeric values. What might I check?
Here is a truncated version of my formula that causes the issue.
Debug.print output looks like this
rLookUpRange = $D$7:$D$11
36?
60?
72?
96?
120?
Here is a truncated version of my formula that causes the issue.
VBA Code:
Function DoTheForLoop(piQty As Long) As String
Dim rAnchorCellCapacity As Range
Dim rLookUpRange As Range
Dim rCell As Range
Dim iDataRows As Long
Set rAnchorCellCapacity = [Data].Range("Header_Capacity")
iDataRows = rAnchorCellCapacity.Offset(10000).End(xlUp).Row - rAnchorCellCapacity.Row
Set rLookUpRange = rAnchorCellCapacity.Offset(1).Resize(iDataRows)
Debug.Print "rLookUpRange = " & rLookUpRange.Address
For Each rCell In rLookUpRange
Debug.Print rCell.Value
Next rCell
End Function
Debug.print output looks like this
rLookUpRange = $D$7:$D$11
36?
60?
72?
96?
120?