jagrenet
Board Regular
- Joined
- Feb 23, 2022
- Messages
- 81
- Office Version
- 365
- 2013
- 2011
- 2010
- Platform
- Windows
Hello,
I am having an issue when copying a regular or standard number such as "3" from one spreadsheet to another using VBA code. The information gets transferred between sheets just fine however, the formatting gets changed from "3" to "44726.8677777778".
There are times where the standard number might be 20.07 or something with 2 digits on either side of the decimal. Other times, just whole numbers. These numbers are representing Total hours worked on a project and subsequently, get compiled on a Monthly Report, the "Target sheet".
The column is "C" and the amount of Rows changes from month to month. So, I have the code counting the Rows using -
Dim iTime As Range
Set iTIme = MyData.Range("C", Cells(Rows.Count, "C").End(xlUp).Offset(-2))
iTime.NumberFormat = "##.##"
I have tried various iterations of setting this variable but it always comes out with the "long" number.
Not sure what I am doing wrong.
Thanks,
Jeff
I am having an issue when copying a regular or standard number such as "3" from one spreadsheet to another using VBA code. The information gets transferred between sheets just fine however, the formatting gets changed from "3" to "44726.8677777778".
There are times where the standard number might be 20.07 or something with 2 digits on either side of the decimal. Other times, just whole numbers. These numbers are representing Total hours worked on a project and subsequently, get compiled on a Monthly Report, the "Target sheet".
The column is "C" and the amount of Rows changes from month to month. So, I have the code counting the Rows using -
Dim iTime As Range
Set iTIme = MyData.Range("C", Cells(Rows.Count, "C").End(xlUp).Offset(-2))
iTime.NumberFormat = "##.##"
I have tried various iterations of setting this variable but it always comes out with the "long" number.
Not sure what I am doing wrong.
Thanks,
Jeff