PC Review


Reply
Thread Tools Rate Thread

Copy a spreedsheet

 
 
Sofia Grave
Guest
Posts: n/a
 
      29th Jul 2009
Hej to all.
I am using Excel 2007 SP2.
I have a command button in my spreedsheet to copy a select area.
But when I copy to a word document it copies also the gridlines. To avoid
this I have to remove always the gridlines in excel before pressing the
button.
the button is only
selection.copy.

How can I copy without THE GRID but keeping the grid in the excel
spreedsheet.

In word I make a paste special - windows enchanted file

Thanks for the time.
Sofia grave

 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      29th Jul 2009
I odn't know if PasteSpecial into word and select Text only will work. If
not try this code

'performing a copy without after/before will create new workbook
set newsht = activesheet.copy
with newsht
'add you code here to delete the gridlines on new worksheet
end with
'kill new workbook
newsht.parent.close savechanges:=false


"Sofia Grave" wrote:

> Hej to all.
> I am using Excel 2007 SP2.
> I have a command button in my spreedsheet to copy a select area.
> But when I copy to a word document it copies also the gridlines. To avoid
> this I have to remove always the gridlines in excel before pressing the
> button.
> the button is only
> selection.copy.
>
> How can I copy without THE GRID but keeping the grid in the excel
> spreedsheet.
>
> In word I make a paste special - windows enchanted file
>
> Thanks for the time.
> Sofia grave
>
>

 
Reply With Quote
 
john
Guest
Posts: n/a
 
      29th Jul 2009
I am no expect copying data from Excel to word but in a quick play, I came up
with this - see if it gives you some ideas.

Hope helpful

Sub ExcelWord()
' requires a reference to the Word Object library:
' in the VBE select Tools, References and check the
' Microsoft Word X.X object library

Dim appWord As Word.Application

Set appWord = New Word.Application

appWord.Visible = True

Range("D6:G10").Copy

appWord.Documents.Add.Content.PasteSpecial Link:=False, _
DataType:=wdPasteText, _
Placement:=wdInLine, _
DisplayAsIcon:=False

Application.CutCopyMode = False

Set appWord = Nothing

End Sub
--
jb


"Sofia Grave" wrote:

> Hej to all.
> I am using Excel 2007 SP2.
> I have a command button in my spreedsheet to copy a select area.
> But when I copy to a word document it copies also the gridlines. To avoid
> this I have to remove always the gridlines in excel before pressing the
> button.
> the button is only
> selection.copy.
>
> How can I copy without THE GRID but keeping the grid in the excel
> spreedsheet.
>
> In word I make a paste special - windows enchanted file
>
> Thanks for the time.
> Sofia grave
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy spreedsheet to word Jim S Microsoft Word Document Management 0 15th Dec 2008 06:52 PM
Spreedsheet view Jasper Recto Microsoft Access Forms 2 19th May 2008 01:31 PM
spreedsheet help loverbwoy Microsoft Excel Misc 1 2nd Apr 2006 05:57 PM
need help with spreedsheet formula systel2 Microsoft Excel Misc 2 13th Feb 2006 04:49 PM
Exporting a spreedsheet Julie Brown Microsoft Excel Misc 1 7th Jan 2004 06:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:55 PM.