Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA: Pasted Cells Not Formatted


When I do a paste special, the cells being pasted don't format
themselves like the cells where I did the copy from. See my structure
below:

'Select Sheet
Sheets("Previous").Select

'Select Cells
Range("A2:B5").Select
Selection.Copy

'Select Sheet
Sheets("Summary").Select
Range("A2:B5").Select

'Do Paste Special
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False

Again, just a novice........but love learning this VBA


Tony


--
ajocius
------------------------------------------------------------------------
ajocius's Profile: http://www.excelforum.com/member.php...o&userid=17695
View this thread: http://www.excelforum.com/showthread...hreadid=389591

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default VBA: Pasted Cells Not Formatted

What formatting isn't copied (font and cell formats copy for me)?

Note that you don't need to select anything. Your macro could be
replaced with one line:

Sheets("Previous").Range("A2:B5").Copy Destination:= _
Sheets("Summary").Range("A2:B5")

Or, if you want to use Paste Special, two:

Sheets("Previous").Range("A2:B5").Copy
Sheets("Summary").Range("A2").PasteSpecial _
Paste:=xlPasteAll, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False


In article ,
ajocius wrote:

When I do a paste special, the cells being pasted don't format
themselves like the cells where I did the copy from. See my structure
below:

'Select Sheet
Sheets("Previous").Select

'Select Cells
Range("A2:B5").Select
Selection.Copy

'Select Sheet
Sheets("Summary").Select
Range("A2:B5").Select

'Do Paste Special
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False

Again, just a novice........but love learning this VBA


Tony

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
Preserving lock on cells even when copied and pasted within a sheet pdgcss Excel Discussion (Misc queries) 0 August 24th 06 11:36 PM
Not all pasted text appears in cells cjswift Excel Discussion (Misc queries) 1 August 8th 05 03:43 PM
cell validation even for values pasted into cells JR_06062005 Excel Worksheet Functions 2 July 13th 05 05:36 PM
Converting 'General' formatted cells to Text formatted cell using. Zahid Khan Excel Worksheet Functions 1 March 12th 05 07:13 PM
how do I remove spaces from cells that were pasted GolfKing Excel Discussion (Misc queries) 1 December 31st 04 07:40 AM


All times are GMT +1. The time now is 09:09 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"