Text value dividing

Something we have to divide some text value for two separated elements. VBA code contained to this post show how to do this. Of course shown code is quite simple – it has to be rebuilt for yours needs.

First of all following values have to be added to sheet – started from A1 cells:
City Name
Ustrzyki Dolne
Piotrowo Pierwsze
Kazimierz Dolny

Thanks to this code text value from column A will be divided for two next columns such as B and C.

Solution 1: function InStr has to be used to return space number position in text value. Next with other text functions separated values are added to next columns:

Sub SpaceSearching()
' Source: https://www.techonthenet.com/excel/formulas/instr.php

Dim SpaceNo, i  As Long
Dim Value1, Value2 As String
Dim CellValueDividing As Long

With ThisWorkbook.ActiveSheet

    For i = 2 To 4
        SpaceNo = InStr(1, .Cells(i, 1), " ")
        Value1 = Mid(.Cells(i, 1), SpaceNo, Len(.Cells(i, 1)) - SpaceNo + 1)
        Value2 = Left(.Cells(i, 1), SpaceNo - 1)
        .Cells(i, 2) = Value2
        .Cells(i, 3) = Value1
    Next i
    
End With

End Sub

Solution 2: an array as a storage for result of SPLIT function:

Sub ArraySpaceSearching()

Dim TempArray() As String
Dim i As Long

With ThisWorkbook.ActiveSheet

    For i = 2 To 4
        TempArray() = Split(.Cells(i, 1), " ")
        .Cells(i, 2) = TempArray(0)
        .Cells(i, 3) = TempArray(1)
        Erase TempArray
    Next i
    
End With

End Sub

122 thoughts on “Text value dividing

  1. Pingback: how to rank my website locally

  2. Pingback: Led Rave Mask

  3. Pingback: validshop in

  4. Pingback: white leaf

  5. Pingback: www.manausa.com

  6. Pingback: nằm mơ thấy rùa đánh số mấy

  7. Pingback: domain registration

  8. Pingback: best dumps site

  9. Pingback: modern warfare cheap

  10. Pingback: mơ thấy đá bóng đánh con gì

  11. Pingback: nằm mơ thấy phật bà quan âm

  12. Pingback: mơ thấy giày dép đánh con gì

  13. Pingback: mơ thấy nhẫn vàng đánh con gì

  14. Pingback: nằm mơ thấy mình thắp hương

  15. Pingback: | dumps with pin | fresh dumps shop | dumps with pins | buying dumps online | dump pin | dump+pin | dumps and pins | dumps and pin | dumps with pin atm cash out | dumps with pin 2020 | free credit card dumps with pin 2020 | dumps with pin shop | dumps wit

  16. Pingback: mơ thấy chìa khóa

  17. Pingback: mơ thấy chim bồ câu đánh con gì

  18. Pingback: mơ thấy con sâu

  19. Pingback: mơ cá trê đánh con gì

  20. Pingback: mơ thấy thầy bói

  21. Pingback: nằm mơ thấy hoa sen

  22. Pingback: nằm mơ thấy ngựa đánh số gì

  23. Pingback: mơ cá sấu đánh con gì

  24. Pingback: agen arahqq

  25. Pingback: fakerolex.ru

  26. Pingback: mơ thấy cầu vồng

  27. Pingback: nằm mơ thấy bướm

  28. Pingback: mơ thấy con trâu đánh đề con gì

  29. Pingback: mơ thấy bếp lửa cháy

  30. Pingback: mơ thấy sếp cũ

  31. Pingback: nằm mơ thấy hôn môi

  32. Pingback: data science analysiss

  33. Pingback: ww88

  34. Pingback: 만화보는사이트

  35. Pingback: w88club.com

  36. Pingback: linzhi phoenixminer

  37. Pingback: http://95.111.232.179/

  38. Pingback: replica breitling watches

  39. Pingback: sell my home

  40. Pingback: baltimore ravens cornhole boards

  41. Pingback: neon sneakers

  42. Pingback: ตู้ล่าม

  43. Pingback: home-remodeling-directory.com

  44. Pingback: mơ thấy mất của

  45. Pingback: mơ thấy quả ổi đánh con gì

  46. Pingback: nằm mơ thấy cãi nhau với người cùng phái

  47. Pingback: google storage

  48. Pingback: mơ thấy đỉa bám đầy người

  49. Pingback: mơ thấy voi danh con gi

  50. Pingback: con ngựa số mấy

  51. Pingback: cách tỏ tình lãng mạn

  52. Pingback: mdjrrotl

  53. Pingback: how much levitra should i take

  54. Pingback: waar kun je viagra kopen

  55. Pingback: where to buy azithromycin for chlamydia

  56. Pingback: cialis

  57. Pingback: viagra pills for sale

  58. Pingback: comprar viagra en andorra

  59. Pingback: essay writing services recommendations

  60. Pingback: how to write research proposal

  61. Pingback: where can i pay someone to write my essay

  62. Pingback: help me wirte a literary essay

  63. Pingback: business law essay

  64. Pingback: augmentin 500 mg tablet price

  65. Pingback: lasix medication generic

  66. Pingback: where to buy azithromycin over the counter

  67. Pingback: buy liquid ivermectin

  68. Pingback: cheapest ventolin online uk

  69. Pingback: generic for doxycycline

  70. Pingback: prednisolone diarrhea

  71. Pingback: clomid 50mg

  72. Pingback: dapoxetine burns tongue

  73. Pingback: diflucan dark urine

  74. Pingback: define synthroid

  75. Pingback: propecia manufacturer coupon

  76. Pingback: neurontin and fibromyalgia

  77. Pingback: janumet vs metformin

  78. Pingback: paxil generic brand

  79. Pingback: plaquenil study

  80. Pingback: metformin 1 00 mg

  81. Pingback: propecia india

  82. Pingback: where can u buy cialis

  83. Pingback: best ed pills

  84. Pingback: canadianpharmacyworld

  85. Pingback: Zakhar Berkut

  86. Pingback: cheap generic cialis

  87. Pingback: canadian discount pharmacy

  88. Pingback: 4569987

  89. Pingback: how to get ciails without a doctor

  90. Pingback: buy cialis 36 hour online

  91. Pingback: news news news

  92. Pingback: psy

  93. Pingback: psy2022

  94. Pingback: projectio-freid

  95. Pingback: male tinder bios

  96. Pingback: kinoteatrzarya.ru

  97. Pingback: topvideos

  98. Pingback: video

  99. Pingback: is viagra safe

  100. Pingback: buy lisinopril no prescription

  101. Pingback: afisha-kinoteatrov.ru

  102. Pingback: Ukrainskie-serialy

  103. Pingback: site

  104. Pingback: crystal rush gold digger gets a creampie new free sex dating site

  105. Pingback: buy 36 hour cialis without prescription

  106. Pingback: lexapro and cialis

  107. Pingback: top

  108. Pingback: generic cialis 20 mg tadalafil

  109. Pingback: cvs pharmacy online store

  110. Pingback: canadian cialis 5mg

  111. Pingback: cialis pills canada

  112. Pingback: ordering cialis online australia

  113. Pingback: pharmacy tech test online

  114. Pingback: canadian pharmacy without a prescription

  115. Pingback: cvs cialis coupon

  116. Pingback: buy cialis online viagra

  117. Pingback: can i buy cialis online

  118. Pingback: best pills for ed

  119. Pingback: 500 mg valtrex daily

  120. Pingback: erection pills that work

  121. Pingback: best place to buy viagra online

  122. Pingback: soderzhanki-3-sezon-2021.online

Leave a Reply

Your email address will not be published. Required fields are marked *