Requesting someone to help on vba/Macro code. I want to set number in each sentence for each cells.Attached screenshot for detail.
Below are the input and expected output. I am new to Macro so please help some one.
Requesting someone to help on vba/Macro code. I want to set number in each sentence for each cells.Attached screenshot for detail.
Below are the input and expected output. I am new to Macro so please help some one.
You could also use a formula and avoid VBA if prefered:
Formula in B1
:
=TEXTJOIN(CHAR(10)&CHAR(10),1,IFERROR(ROW(A$1:INDEX(A:A,LEN(A1)))&"."&FILTERXML("<t><s>"&SUBSTITUTE(A1,CHAR(10),"</s><s>")&"</s></t>","//s[node()]"),""))
Confirm through CtrlShiftEnter
Using XPATH
we return all nodes that have any underlaying value. If you want to know more about the use of FILTERXML
to change around substrings, you may find this an interesting read too.
Note: For the shown results you'd need to enable text wrapping on column B. On the Start
tab under Alignment
click Text Wrap