This is post https://www.excelfox.com/forum/showt...ll=1#post21923
https://www.excelfox.com/forum/showthread.php/2909-Appendix-Thread-Evaluate-Range-(-Codes-for-other-Threads-HTML-Tables-etc-)?p=21923&viewfull=1#post21923
Page #58 https://www.excelfox.com/forum/showt...s-etc-)/page58
https://www.excelfox.com/forum/showthread.php/2909-Appendix-Thread-Evaluate-Range-(-Codes-for-other-Threads-HTML-Tables-etc-)/page58
Some notes arising from discussions in this Thread
http://www.eileenslounge.com/viewtop...61085a6575decc
Edit Aug 2023: The general ideas are OK here, but we all overlooked, or maybe did not understand fully some basic stuff about how Range and range "values" in this basic code line work, Range2.Value = Range1.Value. Because of this some of the stuff in the final actual solution are redundant: - in particular, the solution of 1x and related stuff.
See
https://www.excelfox.com/forum/showt...el-Cell/page10
https://www.excelfox.com/forum/showt...el-Cell/page11
https://www.excelfox.com/forum/showt...el-Cell/page12
Number stored as text, alignment of numeric values in cells
This problem/feature pops up from time to time.
https://i.postimg.cc/GpwT3Mzj/Number-stored-as-text.jpg
Number_stored_as_text.JPG
I have seen it so far in these sort of places/ things, such as text box contents are strings by definition , …VBA enters text that is inherent to a TextBox. Every 'number' in a textBox is a string "1234". VBA has to convert those strings into long/integer, etc….
, and when pasting things out,
https://www.eileenslounge.com/viewto...269105#p269105 https://eileenslounge.com/viewtopic....272704#p272704
, but it’s not always consistent, - in the next example the 3 seems to go in as a number, but the 4 and 5 go in as …" Number stored as text"
https://i.postimg.cc/cCzwRfG1/Number...onsistancy.jpg
Code:
' https://www.excelfox.com/forum/showthread.php/2909-Appendix-Thread-Evaluate-Range-(-Codes-for-other-Threads-HTML-Tables-etc-)?p=21923&viewfull=1#post21923
Sub Number_stored_as_text__alignment_of_numeric_values_in_cells() ' https://i.postimg.cc/cCzwRfG1/Number-stored-as-text-inconsistancy.jpg
Dim Ex As String
Let Ex = "3"
Let ActiveSheet.Range("A10").Value = Ex ' Puts in as number
Dim Exs(1 To 2) As String: Let Exs(1) = "4": Exs(2) = "5"
Let ActiveSheet.Range("A11:B11").Value = Exs()
End Sub
Bookmarks