hi , i have a set of data in excel.. i want that, when i click a command button on an active worksheet, it will be transferred in ms word all the data found in excel. is it possible?
hi , i have a set of data in excel.. i want that, when i click a command button on an active worksheet, it will be transferred in ms word all the data found in excel. is it possible?
This can be done -- trouble is if the spreadsheet is large the pages go a bit funky
Tools | References make sure that "Microsoft Word 10.0" is ticked or it wont work
Please Login or Register to view this content.
hi jack, the spreadsheet is not too large. i think it will only occupy two sheets in word with double space. i tried to copy it manually. but it would be helpful if there's a code.
hi jack, it wont work.. im sorry, im just new to vba... here is the code i paste on the module...
Private Sub CommandButton1_Click()
Option Explicit
Sub my_EXCEL_to_WORD()
Dim Microsoft_WORD As Word.Application
Set Microsoft_WORD = CreateObject("Word.Application")
Microsoft_WORD.Visible = True
' Change the range to what you need
**** Put Your range in here
Microsoft_WORD.Documents.Add
Microsoft_WORD.Selection.Paste
Application.CutCopyMode = False
the_END:
Set Microsoft_WORD = Nothing
Exit Sub
End Sub
Try this - make sure that only this code is behind the cmd button
Please Login or Register to view this content.
Last edited by Jack in the UK; 12-01-2009 at 09:10 AM. Reason: Code Tags oppps - jiuk
miyat,
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
Please edit your post.
This is addition to being another cross post - you were warned of this practice and required links earlier today yet you have chosen to ignore this.
Please ensure you both read and subsequently adhere to the Forum Rules from this point forth.
Further transgressions of this manner will lead to your account being suspended.
Last edited by DonkeyOte; 12-01-2009 at 09:35 AM.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
hi, sorry for cross-posting... it wont happen again.. by the way jak, it doesn't work again... have i missed something? what shall i do?
Please Login or Register to view this content.
miyat, you have yet to amend your earlier post re: Code tags....
hi donkeyote... i just wrap my code... what do u mean by amend my code tags? please help me understand that..my apologies...
I'm not referring to the post you made after my post regards your lack of Code tags - that would be a little pre-emptive (even for me), no ?
Look at your 3rd post down, its needs code tags. I will not / can not help unless you do as the moderators wont let me, besides its only fair we stick by the rules, come on chap!
-- jiuk
In addition to the CODE tags we're also expecting you to detail any and all cross post(s) by means of links - I know of one at MrE - but there may be others that should be listed also
(should they exist there's a good chance they will be spotted by others)
my sincere apology my friends... it wont happen again... im sorry... anywayz, can anyone know about this? is there a way? tnx...
Miyat, our requirements are quite clear
a) use CODE tags
b) provide links to any/all cross posts
You have done neither.
In the space of about a day you've managed to break pretty much every rule indeed you left this thread and then posted a question in the thread of another member
I am closing this thread down while you take a 7 day break.
If you choose to come back after your break and you wish to pursue this further PM me and I will re-open the thread at which point your first action will of course be to account for the above requirements ...
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks