TheRedCardinal
Active Member
- Joined
- Jul 11, 2019
- Messages
- 250
- Office Version
- 365
- 2021
- Platform
- Windows
A simple part of my macro performs the following task:
I got around this by introducing this step before the loading of the array:
Visually at least this solved the problem for me in the source data, specifically that the scientific numbers are now standard, but also the non-numeric entries are unchanged.
I then did the various manipulation, and when I output the array, unfortunately the scientific notation is back.
All of the cells in the target array are set to text format:
So I then added the same code as before for the specific column in the target range:
But now my output works for the scientific numbers, but for all of the cells that contained text, now there is a number pasted, the source of which I can't determine.
For completeness, inside my loop this is the line that populates the new array with the data:
I'm not sure how to proceed with this now? Any suggestions?
- Loads all of the data in a specified range into an array
- Plays around with that data and outputs it into a different array
- Pastes that array into a dynamic range on another worksheet
I got around this by introducing this step before the loading of the array:
VBA Code:
.Range("D:D").NumberFormat = "0"
Visually at least this solved the problem for me in the source data, specifically that the scientific numbers are now standard, but also the non-numeric entries are unchanged.
I then did the various manipulation, and when I output the array, unfortunately the scientific notation is back.
All of the cells in the target array are set to text format:
VBA Code:
.Cells.NumberFormat = "@"
So I then added the same code as before for the specific column in the target range:
VBA Code:
.Range("I3:I" & LRow + 1).NumberFormat = "0"
But now my output works for the scientific numbers, but for all of the cells that contained text, now there is a number pasted, the source of which I can't determine.
For completeness, inside my loop this is the line that populates the new array with the data:
VBA Code:
RecibArray(Counter, 9) = SAPArray(Counter, 4)
I'm not sure how to proceed with this now? Any suggestions?