D
D
Diana Stoyka2021-03-25 11:28:55
Visual Basic
Diana Stoyka, 2021-03-25 11:28:55

How to split text into letters and write one per cell?

1.The user sets the text
2.the program breaks the text into letters
3.writes the letters into cells starting from A4 horizontally

The first one understood that Inputbox should be used, the second one understood Len to find out how many letters and Mid.
In the third, everything is clear only the letters how to write down one at a time?
In general, I do not know how to write code in Excel correctly.
Thank you in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
idShura, 2021-03-25
@Dianka05

I do not want to write a ready-made solution, so I will give an example.
Pass the value from the Inputbox to the Text variable and correct the cell in which you want to display the values ​​in the loop.

Text = "абвгд"
    
    For i = 1 To Len(Text)
        Cells(1, i) = Mid(Text, i, 1)
    Next

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question