Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Copy a spreedsheet

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Copy a spreedsheet

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Copy a spreedsheet

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross country spreedsheet will gerrish Excel Discussion (Misc queries) 11 September 29th 09 07:59 PM
Remove Password From Spreedsheet Bryan Excel Discussion (Misc queries) 3 April 3rd 09 05:24 AM
spreedsheet help loverbwoy Excel Discussion (Misc queries) 1 April 2nd 06 05:57 PM
spreedsheet protection jnu Excel Worksheet Functions 0 March 22nd 06 03:05 PM
need help with spreedsheet formula systel2 Excel Discussion (Misc queries) 2 February 13th 06 04:49 PM


All times are GMT +1. The time now is 12:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"