Answer the question
In order to leave comments, you need to log in
Formula to wrap words when exceeding a given length of characters in an excel cell?
There is a phrase in the cell for example, "Concrete with delivery in St. Petersburg." How to make it so that when the number of required characters (33) is exceeded, the extra word is transferred to the next. cell? Those. we have 2 cells "Concrete with delivery" and "in St. Petersburg".
Answer the question
In order to leave comments, you need to log in
In general, the restriction is strange, think about whether it is necessary.
If yes, there are two options, and both with a macro.
1) the easiest way to implement is to enter data through a macro. A simple macro is written that receives data in the inputbox, determines the length, cuts if necessary, and writes to a cell or two. The macro is hung up on some convenient combination of hot keys. Not very comfortable.
2) enter the data as is, and then set the macro on the data range.
More difficult, because you need to determine the range, check the validity of the selected range (ideally), if there is text behind the split cell, insert an empty line in front of it so as not to overwrite the existing text with a split one on two lines. But it's convenient - I entered a sheet of data, set a macro - and go ahead.
3) The most correct thing is to provide the vba table with a code that will check the data immediately after entering (for example, through Worksheet_Change). And if necessary, do what is described in paragraph 2.
With knowledge of English and a vague knowledge of Pascal / Basic from school and the presence of Google, a non-programmer writes (1) in 5-15 minutes, (2) in 0.5-3 hours, (3) in 0.5-4 hours with coffee breaks.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question