View Single Post
 
Old 11-25-2015, 08:55 PM
PRA007's Avatar
PRA007 PRA007 is offline Windows 7 32bit Office 2010 32bit
Competent Performer
 
Join Date: Dec 2014
Location: Ahmedabad, Gujrat, India
Posts: 145
PRA007 is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
If nothing is found, there is nothing to process and, hence, nothing to add.
As I told, I don't have much knowledge right not regarding vba. I don't know from the code where to skip adding data.

For example

Code:
With .Cell(i, 4).Range
          If Len(.Text) > 2 Then
            .InsertBefore "Er.Prio: " & StrTxt3 & vbCr
          Else
            .InsertBefore "Er.Prio: " & StrTxt3
          End If
from above code it is adding Er.Prio: everywhere irrespective of column 2 search find.

Quote:
Originally Posted by macropod View Post
What if there is less than 5 paragraphs or more than 5 paragraphs?
As I told, I don't have much knowledge right not regarding vba. I Just want to start My search from .Cell(i, 2).Range.Paragraphs(1) but not limited to paragraph(1). There are more/less than one paragraph sometimes in the document.

I don't know how to make this things happen.
My search string is

Code:
WO [0-9]{5,} [A-Z0-9]{1,2}^13*13[A-VX-Z][A-Z]
Please note that this string has nothing to do with current code but have much usefulness on overall process. please see

Quote:
2. If column 2 first paragraph contains WO number like WO 2015171641 A1, and if there is no paragraph 3.
for example

column 2 cell
WO 2015171641 A1¶
Some text¤

I want to search WO number and add in main.docx following data from database.xlsx.

column 3 = add text "International Publication"
column 4 = Column E from Database.
column 5 = column B from database &vbCr & column C from database
Reply With Quote