![]() |
|
#1
|
||||
|
||||
![]()
You could try changing:
.Cell(i, 3).Range.Text = StrTxt to: .Cell(i, 3).Range.InsertBefore StrTxt & vbcr
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
||||
|
||||
![]()
After trial and error I could find why my error '91' is still there.
Coincidently document I provided contains all the occurrences of word find in the corresponding database files. In my day to day word there may be some US numbers that may not be present in excel document. In those cases I want to go ahead without adding anything. Is there any way to skip if the search not foud |
#3
|
||||
|
||||
![]() Quote:
That's what the code already does.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
||||
|
||||
![]()
It worked perfect for first sample files I provided.
Please forgive me for providing new sample files as it seems the only solution for now. In my current sample file there are all the elements (or say possible problems). For my current file till raw 4 your code works fine after that when it comes to raw 5 it shows error. I thought error is because US RE44048 is not present in the database 1 file. I don't know what the problem is but it shows I got temporary solution. I recorded macro to remove US [0-9]{5} and US [0-9]{8,11} in a temporary It works fine for now. I Replaced column 3 then with original document. Code:
Run-time Error '91': Object Variable or with block variable not set. I don't have any clue whats going on now. Please find my files at: https://sites.google.com/site/rtsk2015/fo Download: Main.docx Download: Database1.xlsx Last edited by PRA007; 10-31-2015 at 04:40 AM. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
PRA007 | Word Tables | 4 | 03-17-2015 11:05 PM |
Retrieving data from data base based on text selection | capitala | PowerPoint | 0 | 12-10-2014 08:10 AM |
![]() |
jmaxcy | Excel | 14 | 11-01-2013 04:07 PM |
Inserting text from one word file into another based on an excel input | jmaxcy | Word | 3 | 11-01-2013 01:26 AM |
Is there a way to do this? (automatically enter text based on form data) | TIKKI555 | Word | 0 | 05-26-2010 09:21 AM |