|
-
Jan 30th, 2009, 04:40 AM
#1
Thread Starter
Member
Loop in copy paste code
Hello
I wrote a code that copies the cells from a specific range in Excel and pastes them to a specific Bookmark in Word.
The code looks something like this:
Application.Goto ActiveWorkbook.Sheets("Sheet1").Range("A1:W15")
Selection copy
WordDoc.Bookmarks("Bookmark1").Select
WordApp.Selection.Paste
Application.Goto ActiveWorkbook.Sheets("Sheet2").Range("A1:W15")
Selection copy
WordDoc.Bookmarks("Bookmark2").Select
WordApp.Selection.Paste
The problem now is that allthought I wrote the code allready the code now has ended being 120 pages or something and it is very Mouse Wheel to browse through
Do you think there is a way to loop the process? Can I use variables or something else where the ranges in excel and where the bookmarks are written in the code?
Thank you very much
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|