Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default VBA Copy a range with Formats & Vaues Only

Hi,

Would anyone know how to copy data from one workbook to another and include
the Values and Formatting only ie: not the formulas.

I can copy either the values or the formats but don't seem to be able to
copy both...

Workbooks("a.xls"). _
Worksheets("b"). _
Range("A1:C27").Copy

Workbooks("a.xls"). _
Worksheets("Sheet1").Range("A1:C27").PasteSpecial xlPasteValues

it would be lovely if someone could help with this.

--
Thanks... Jinx
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default VBA Copy a range with Formats & Vaues Only

Add a line:

Worksheets("Sheet1").Range("A1:C27").PasteSpecial
Paste:=xlPasteFormats

Hth,
Merjet

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default VBA Copy a range with Formats & Vaues Only

One way:

With Workbooks("a.xls")
.Worksheets("b").Range("A1:C27").Copy
With .Worksheets("Sheet1").Range("A1:C27")
.PasteSpecial xlPasteValues
.PasteSpecial xlPasteFormats
End With
End With

In article ,
jinx wrote:

Hi,

Would anyone know how to copy data from one workbook to another and include
the Values and Formatting only ie: not the formulas.

I can copy either the values or the formats but don't seem to be able to
copy both...

Workbooks("a.xls"). _
Worksheets("b"). _
Range("A1:C27").Copy

Workbooks("a.xls"). _
Worksheets("Sheet1").Range("A1:C27").PasteSpecial xlPasteValues

it would be lovely if someone could help with this.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default VBA Copy a range with Formats & Vaues Only

Marvellous... thanks very much
--
Thanks... Jinx


"merjet" wrote:

Add a line:

Worksheets("Sheet1").Range("A1:C27").PasteSpecial
Paste:=xlPasteFormats

Hth,
Merjet


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default VBA Copy a range with Formats & Vaues Only

lovely.... thanks very much... and sooo fast!
--
Thanks... Jinx


"JE McGimpsey" wrote:

One way:

With Workbooks("a.xls")
.Worksheets("b").Range("A1:C27").Copy
With .Worksheets("Sheet1").Range("A1:C27")
.PasteSpecial xlPasteValues
.PasteSpecial xlPasteFormats
End With
End With

In article ,
jinx wrote:

Hi,

Would anyone know how to copy data from one workbook to another and include
the Values and Formatting only ie: not the formulas.

I can copy either the values or the formats but don't seem to be able to
copy both...

Workbooks("a.xls"). _
Worksheets("b"). _
Range("A1:C27").Copy

Workbooks("a.xls"). _
Worksheets("Sheet1").Range("A1:C27").PasteSpecial xlPasteValues

it would be lovely if someone could help with this.


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
Copy Range including Formats and Forumulas ALV Excel Programming 1 February 23rd 07 09:15 PM
How can I find vaues of cells using 2 search criteria? Spinnerron Excel Programming 3 November 15th 05 01:19 AM
validation and omitting blank vaues from list MGOETZ Excel Worksheet Functions 3 May 20th 05 09:24 PM
copy range and formats to new workbook Ole[_4_] Excel Programming 0 May 18th 05 08:56 PM
Copy range and formats to new Workbook ole_ Excel Programming 4 May 18th 05 09:57 AM


All times are GMT +1. The time now is 10:19 AM.

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"