S
S
Sergey2019-02-19 13:38:56
excel
Sergey, 2019-02-19 13:38:56

How to insert substrings of a string into Excel cells?

I am writing my first program. I take a long string from the datagridview cell and after that I need to split it into substrings in order to insert each substring into a separate Excel cell in a column, in one row.
The length of each substring must be equal to the width of the Excel column. In the first cell, the first substring is inserted after the existing text (replacing ###substring1& with the text of the substring), in the remaining cells there is initially no text, just inserting a substring (replacing ###substringХ& with the rest of the text of the substrings of the string).
I did not find a solution on the Internet, Google did not help ..
Thank you in advance.
5c6bdb224f302788870054.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MamaLuyba, 2019-02-19
@MamaLuyba

You beat a line on substrings, you write down them in an array. You join the first element of the array with the first row. Paste the following elements into the rest of the cells. Width is set via parameters.
Or do you need ready-made VBA code?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question