Hello all,
My workbook is slowly coming along thanks to all the help on this forum, but I'm now truly befuddled.
Sheet 5 (named RESULTS) has data appended to it in table form using a VBA - basically it copies certain cells from another sheet and adds these to the next empty row in RESULTS sheet.
This starts at B2 and uses 6 columns (so B2 to G2). There are a variable amount of rows depending on how many tests are done (so the range will be B2 to Gx).
What I want to do is for excel to open a word template (C:\test.dot) and put the info from B2 - Gx into table form into Word. But I can't do it! I've tried Professor Google but everyone else's code doesn't seem to work for me.
Oh - it's excel 2003 I'm using (my employers too tight to upgrade!)
Many thanks.
Last edited by wonderdunder; 10-25-2010 at 03:43 PM.
Can you post the test.dot so we can fix it up to do what you need?
Bob
Click my star if my answer helped you. Mark the thread as [SOLVED] if it has been.
I've managed to do it now, thanks.
However, I do need help in getting to paste the data to a specific location on the worksheet.
I'll post what I have tomorrow when back at work.
Thanks.
Well, erm, I've sorted that one too! But anyway, here's the code in case it can be of use to anyone else (and if anyone can improve please feel free!). I do need help on another matter though so there will be yet another plea for help!
Private Sub CommandButton1_Click()
'copy range from b2 to last cell
Range("b2", Range("b2").End(xlToRight).End(xlDown)).Copy
'select word
Dim wdapp As Word.Application
Set wdapp = GetObject(, "word.application")
'select bookmark in word named fromexcel and paste there
With wdapp.Selection
wdapp.Selection.GoTo What:=wdGoToBookmark, Name:="fromexcel"
Paste
End With
End Sub
go ahead and mark this thread [SOLVED] and start a new one with other questions.
Bob
Click my star if my answer helped you. Mark the thread as [SOLVED] if it has been.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks