Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default How to export a linked cell sheet to get only values.

Dear all

Sheet1 full of data. Sheet2 has select info linked to some cells from sheet1.

This is sheet2 when exported gives undesired results.

Is it the only way to write in VB to copy and paste only the values??

Pls suggest how to copy say the linked sheet2 to be pasted in new workbook
with formats, like same width of coulmns and rows, coloring and most of all
only the values. Or in VB do I have to copy and paste in new workbook as
values and then as Mr. Mark suggested to create a macro to format the first
row of column and paste the format to the remaining rows.

Would like to know best way to do it, though I have been doing with
activesheet.paste and then format the cells or sheep copy to new work book..

Pls hlep

brgds/captgnvr
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default How to export a linked cell sheet to get only values.

Is it the only way to write in VB to copy and paste only the values??

in my personl.xls I have this macro and a button on my toolbar (excel.xlb):

Sub ExportSelection()
'Exports the current selection to a new workbook (formats and values)
Selection.Copy
Workbooks.Add Template:="Workbook" 'language specific, uses then the
usual template
Cells(1, 1).Select
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False
Selection.PasteSpecial Paste:=8, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False 'columwidth (excel bug, this why
Paste:=8)
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False
Application.CutCopyMode = False
End Sub

arno


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default How to export a linked cell sheet to get only values.

D/ARNO
Thanks your quick help. Tried like u suggested but get error at
(ceels(1,1).select

Can u also explain about the excel bug for columwidth amd the reason for
passte:=8 .

Also will this copy and paste as it is seen in sheet2.

brgds/captgnvr

"arno" wrote:

Is it the only way to write in VB to copy and paste only the values??


in my personl.xls I have this macro and a button on my toolbar (excel.xlb):

Sub ExportSelection()
'Exports the current selection to a new workbook (formats and values)
Selection.Copy
Workbooks.Add Template:="Workbook" 'language specific, uses then the
usual template
Cells(1, 1).Select
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False
Selection.PasteSpecial Paste:=8, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False 'columwidth (excel bug, this why
Paste:=8)
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False
Application.CutCopyMode = False
End Sub

arno



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default How to export a linked cell sheet to get only values.

Hi,

Thanks your quick help. Tried like u suggested but get error at
(ceels(1,1).select


if the cursor in your standard sheet is in A1 then you can delete this line,
however, I do not know why this should not work. Step through the code with
F8 to see if a new workbook is opened, remove my comments.

Can u also explain about the excel bug for columwidth amd the reason for
paste:=8 .


This is an Excel bug. Paste:=xlPasteColumnWidths simply does not work so you
have to youse paste:=8 to make the makro compatible with all versions of
excel. I do not know if this was solved in Excel 2003 or 2007.

arno


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
How can a drop down list be linked to values on another sheet? Deezel Excel Discussion (Misc queries) 1 August 21st 08 08:28 AM
Query linked cell values i_am_wookiee Excel Worksheet Functions 0 February 22nd 08 12:11 AM
Replacing Linked Cell Values w/ Current Values TomCat Excel Worksheet Functions 6 April 10th 06 12:20 PM
Cell linked to a range of cell values in different sheet szeng Excel Discussion (Misc queries) 1 August 9th 05 02:41 AM


All times are GMT +1. The time now is 12:04 AM.

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

About Us

"It's about Microsoft Excel"