Hello:

Newbie Here and Novice to VBA -- I know just enough to be Dangerous.



I have a working excel macro that copies cell "Z" in the Active Row and places text from it into the Active Word Document at the position of the Cursor.

I could really use some help to add a Second Copy and paste to my Macro. This one involves the data in the Same Active Excel Row - Cell "S" being Copied to a "specific" Location in the same word document.

The Specific Location in the Word Document can best be positively identified by " the First Line after the first occurrence in the word document of more that 10 -'s"


----------------------------------
X


X being the place the paste needs to be applied.

There may be several other ways to specify the position. But, I believe this to be the most constant locator.
I thought about using some form of offset command but inconsistent amounts of text already in the Document leaves variance to the position of the cursor relative to the place I need Cell S placed. ( Its not always in the same Line Number dependent on size of address and other text above it )

Thinking that a Loop from the top of the Document that finds >10 -'s + 1 line will be the most constant but don't know how to implement it.

Will the text is Cell "S" have to be defined as another object ?

Here is my working Excel Macro that pastes Cell Z into the Document at the position of the cursor.

Please Login or Register  to view this content.


Here is an Example of Text in my Word Doc -- Number of lines in address can vary as well as the lines of info in the description. You can see the first line with > 10 --------'s about half way down -- its position may vary but it is in every document.

1

Record Garden
Box xxx
Middle Or 97xxx

Baland Colagete
68744 Marvel Ave.
Flatland, MO.63127
US



Order Number: 002-2902130-4028262
Purchase Date: 2011-07-20 07:26:44 PDT
Shipped By: standard
Buyer Name: Baland Colagete


Brand New book right off the shelf of a closed store - Trade Paperback


Item: Jungle Lady [Import] Oates, Titus
SKU: 123888
Quantity: 1
---------------------------------


Order Number: 002-2902130-4028262
Purchase Date: 2011-07-20 07:26:44 PDT
Shipped By: standard

Shipping Address:
Baland Colagete
68744 Marvel Ave.
Flatland, MO.63127
US
Buyer Name: Baland Colagete


Item: Jungle Lady [Import] Oates, Titus
Quantity: 1
SKU: 123888
---------------------------------



Its about 3 AM here -- Off to bed but will return to computer in 7 hours or so.


I really appreciate your time to look . I will be happy to provide any other info that I can to help. Any Explanation you can give with your ideas is much appreciated. Trying to learn as much as I can about this.

Thanks