Results 1 to 10 of 604

Thread: Appendix-Thread-Evaluate-Range-(-Codes-for-other-Threads-HTML-Tables-etc-)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,319
    Rep Power
    10

    Number stored as text, alignment of numeric values in cells

    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
    Last edited by DocAElstein; 08-06-2023 at 09:06 PM. Reason: Well, I thought someone should

Similar Threads

  1. Testing Concatenating with styles
    By DocAElstein in forum Test Area
    Replies: 2
    Last Post: 12-20-2020, 02:49 AM
  2. testing
    By Jewano in forum Test Area
    Replies: 7
    Last Post: 12-05-2020, 03:31 AM
  3. Replies: 18
    Last Post: 03-17-2019, 06:10 PM
  4. Concatenating your Balls
    By DocAElstein in forum Excel Help
    Replies: 26
    Last Post: 10-13-2014, 02:07 PM
  5. Replies: 1
    Last Post: 12-04-2012, 08:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •