samjsteffes
New Member
- Joined
- Feb 27, 2018
- Messages
- 16
Hi all,
Hopefully its just a quick solution needed here:
I have a table column that contains imported datetime values. I have formatted them as 'dd-mmm-yy', and am trying to extract counts that fall between different date ranges. However, I've noticed that the values are not truly integers, but instead carry a decimal value (i.e. 43109.44722). This is messing up the counts that I am extracting, as the date ranges I choose will be for example: 43100.0000 to 43109.0000.
After some research I've tried the following to no avail:
I've stepped through the code, and the .NumberFormat commands are performing as expected, but the Int(.Value) has no effect on the values; they maintain their decimal throughout the code before converting back to 'dd-mmm-yy' format.
I've also tried the CInt function (which is not ideal, since I wan't everything rounded down), as well as a more robust WorksheetFunction.RoundDown(.Value, 5).
What am I overlooking?
Appreciate any help!
-sjs
Hopefully its just a quick solution needed here:
I have a table column that contains imported datetime values. I have formatted them as 'dd-mmm-yy', and am trying to extract counts that fall between different date ranges. However, I've noticed that the values are not truly integers, but instead carry a decimal value (i.e. 43109.44722). This is messing up the counts that I am extracting, as the date ranges I choose will be for example: 43100.0000 to 43109.0000.
After some research I've tried the following to no avail:
Code:
With tbl.ListColumns("Date Reported").DataBodyRange
.NumberFormat = "General"
.Value = Int(.Value)
.NumberFormat = "dd-mmm-yy"
End With
I've stepped through the code, and the .NumberFormat commands are performing as expected, but the Int(.Value) has no effect on the values; they maintain their decimal throughout the code before converting back to 'dd-mmm-yy' format.
I've also tried the CInt function (which is not ideal, since I wan't everything rounded down), as well as a more robust WorksheetFunction.RoundDown(.Value, 5).
What am I overlooking?
Appreciate any help!
-sjs