thanos54321
Programmer
Hi, I couldn't find any threads containing this issue, and I'm very rusty on VBA at the moment, so I need some help.
Specifically, I'm trying to select some text like
that is, text including soft line breaks, in word, and copying to excel. The problem is, excel thinks the line breaks indicate that the next line is put into a new cell.
An easy manual way around this is to select the cell in excel, press F2 and paste it. Hooray!
Now comes the tricky part (for me at least): I want to replicate this move in a macro, but if I just record it, the code includes the actual text pasted (as in the same text every time), instead of what happens to be in the clipboard. This I'm absolutely blank on how to do. Can you help?
Finally, a refinement is that the first line is ALWAYS a headline, that I want to clip out, delete the blank line, and move the header to the cell to the left in excel. Is this possible? Example:
1:
Headline
BlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablabla
BlablablablaBlablablablaBlablablablaBlablablablaBlablab
BlablablablaBlablablablaBlablablabla
2:
'clipped out: Headline, but the empty line is still there'
BlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablabla
BlablablablaBlablablablaBlablablablaBlablablablaBlablab
BlablablablaBlablablablaBlablablabla
3:
BlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablabla
BlablablablaBlablablablaBlablablablaBlablablablaBlablab
BlablablablaBlablablablaBlablablabla
4: paste Headline in the cell to the left
I hope you're able to help, and I thank you for your time.
Specifically, I'm trying to select some text like
that is, text including soft line breaks, in word, and copying to excel. The problem is, excel thinks the line breaks indicate that the next line is put into a new cell.
An easy manual way around this is to select the cell in excel, press F2 and paste it. Hooray!
Now comes the tricky part (for me at least): I want to replicate this move in a macro, but if I just record it, the code includes the actual text pasted (as in the same text every time), instead of what happens to be in the clipboard. This I'm absolutely blank on how to do. Can you help?
Finally, a refinement is that the first line is ALWAYS a headline, that I want to clip out, delete the blank line, and move the header to the cell to the left in excel. Is this possible? Example:
1:
Headline
BlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablabla
BlablablablaBlablablablaBlablablablaBlablablablaBlablab
BlablablablaBlablablablaBlablablabla
2:
'clipped out: Headline, but the empty line is still there'
BlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablabla
BlablablablaBlablablablaBlablablablaBlablablablaBlablab
BlablablablaBlablablablaBlablablabla
3:
BlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablablaBlablablabla
BlablablablaBlablablablaBlablablablaBlablablablaBlablab
BlablablablaBlablablablaBlablablabla
4: paste Headline in the cell to the left
I hope you're able to help, and I thank you for your time.