|
-
Sep 6th, 2012, 01:25 PM
#1
Thread Starter
New Member
Help With Coding Please
Hi All,
I am currently trying to write some simple code in Excel in order to paste some excel tables into word one after the other with a space in between each.
I am getting there however I cannot get a space in between in the tables which is rather frustrating me, can anybody please advise?
Here is the code as I have currently written it - This is only for two of the tables another 5 also need to be incorporate however I will roll the code once I know how to get the space in between!
Sub Macro1()
'
' Macro1 Macro
'
'
Range("A7:G28").Select
Selection.Copy
Set WordApp = CreateObject("Word.Application")
WordApp.Visible = True
Set WordDoc = WordApp.Documents.Add
WordApp.Selection.Paste
Application.CutCopyMode = False
Range("A33:G54").Select
Selection.Copy
WordDoc.Paragraphs.LineSpacingRule = wdLineSpaceDouble
WordDoc.Paragraphs.Add
WordApp.Selection.Paste
Application.CutCopyMode = False
End
End Sub
If anybody can please advise I would be most grateful indeed.
Thanks,
Bejay
-
Sep 7th, 2012, 09:35 AM
#2
Re: Help With Coding Please
Moved to the Office Development forum.
-
Sep 8th, 2012, 10:09 PM
#3
Re: Help With Coding Please
you could try
wordapp.Selection.TypeParagraph
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
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
|