Convert Text to Number with VBA

Поделиться
HTML-код
  • Опубликовано: 15 сен 2024
  • How to convert numbers displayed as text back to numbers on the fly. File here:
    www.thesmallma...

Комментарии • 23

  • @Jane-kn7rj
    @Jane-kn7rj 2 года назад +1

    Excellent! Thank you very much for this.

  • @cagatay3340
    @cagatay3340 2 года назад +1

    Hi Marcus,
    I would like to implement this on multiple columns. How can i make it possible? In addition, i want to do it over one sheet on excel workbook. Could you please share me full code from beginning to end point? I really need this code.
    Thanks

  • @MeyWorking
    @MeyWorking 4 года назад +1

    THANK YOUUUUUUUUUUUUUUUUU!!!!! YOU ARE AWESOME ! GREAT VIDEO !!

  • @walkstreets
    @walkstreets 2 года назад +1

    Hi Marcus, How to get the output in diferent worksheet on same workbook rather output on same sheet?

    • @thesmallman
      @thesmallman  4 месяца назад

      You just refer to the sheet you want to put the output on before the range reference. In vba it is workbook.worksheet.range.action. I have provided range.action. You just add worksheet.range.action and t hat will get your data on the other sheet.

  • @aditirai8963
    @aditirai8963 3 года назад +1

    Can you make a video on how to print 10 diff number using inputbox and print it on cells

  • @sandeepkothari5000
    @sandeepkothari5000 4 года назад +1

    Thanks Marcus.

  • @mauricelee2219
    @mauricelee2219 4 года назад +1

    Thank you, sir.

  • @jundidoang7346
    @jundidoang7346 4 года назад +1

    Very good tutorial. My question: how to convert text to number in its own column? In other word: in same position. Thank you

    • @thesmallman
      @thesmallman  4 года назад

      Hi Jundi - I showed that in the first 30 seconds of the video. If you want to do it with code, it depends how the column is formatted, to take the formatting out of the equation, using col A as our example the following:
      [A:A].NumberFormat = "General"
      [A:A] = [A:A].Value
      That will work.

  • @shivanimahida5544
    @shivanimahida5544 Год назад

    This is not working for me please help

  • @shivanimahida5544
    @shivanimahida5544 Год назад

    Heyy its not workin for me its turning the nunbers into 0 rather than converting text to number.

    • @thesmallman
      @thesmallman  9 месяцев назад

      You and I are both using the same version of Excel so the reason it is not working is your did not follow the instructions carefully enough. It would not have worked for me if I had done what you did. Watch again and come back on here and tell others what you did wrong so everyone learns.

  • @flance4011
    @flance4011 3 года назад

    this works on column U.
    How can I amend it to work on columns O to U ?
    Sub texttoNum6() 'Excel VBA dynamic example of the text to numbers procedure.
    Dim ar As Variant
    Dim var As Variant
    Dim i As Long
    Dim lr As Long
    lr = Range("u" & Rows.Count).End(xlUp).Row
    ar = Range("u2:u" & lr)
    ReDim var(1 To UBound(ar), 1 To 1)
    For i = 1 To UBound(ar) 'Start of VBA loop
    var(i, 1) = ar(i, 1) * 1
    Next i
    Range("u2:u" & lr) = var
    End Sub

    • @thesmallman
      @thesmallman  3 года назад

      Two Lines need to change:
      ar = Range("O2:U" & lr)
      and
      Range("O2:U" & lr) = var
      Should work fine.
      Marcus

  • @shivanimahida5544
    @shivanimahida5544 Год назад

    Its not working for me

    • @thesmallman
      @thesmallman  6 месяцев назад

      You have not followed the instructions exactly. I'm using office 365 if we are both using the same version of Excel if you copy everything that I do you will get the same result.

  • @lagusgoudas2705
    @lagusgoudas2705 2 года назад

    please send me this code in email box thank you