Rahul Agarwal
New Member
I have to copy data present in a cell into word document and if cell is empty NTR should be written in Word File. Using below code I am facing some issue as I have to remove all blank lines present between data in a particular cell, but this code is also pasting blank lines between data.
Talent can be anything - Singing, Dancing, Fashion, Mimicry
You will get a chance to meet Celebrity influencers from TVF
A shoot team from TVF would also be there to cover the event.
Talent can be anything - Singing, Dancing, Fashion, Mimicry
You will get a chance to meet Celebrity influencers from TVF
A shoot team from TVF would also be there to cover the event.
- If data to be copied from cell A2 is :
Talent can be anything - Singing, Dancing, Fashion, Mimicry
You will get a chance to meet Celebrity influencers from TVF
A shoot team from TVF would also be there to cover the event.
- In Word File data should get pasted in this way (omitting blank line):
Talent can be anything - Singing, Dancing, Fashion, Mimicry
You will get a chance to meet Celebrity influencers from TVF
A shoot team from TVF would also be there to cover the event.
Code:
ActiveDocument.Bookmarks(BM_name).Select
If IsEmpty(sheet.Sheets("Weekly Update").Range(Cell_name).Value) = True Then
Selection.TypeText Text:="NTR"
Else
sheet.Sheets("Weekly Update").Range(Cell_name).Borders.LineStyle = xlNone
s = Trim(sheet.Sheets("Weekly Update").Range(Cell_name).Value)
Selection.TypeText Text:=s
End If