Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 504
Default Cleaning up code


Hi I recorded a copy/paste special as values macro but am sure there is a
more elegant way of writing the code. what part of the code below is not
necessary?

Sheets("Market").Select
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("A1").Select

Thanks
Kevin
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Cleaning up code


I missed the paste special..Try the below

Sub Macro2()
Sheets("Market").UsedRange = Sheets("Market").UsedRange.Value
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"kevin" wrote:

Hi I recorded a copy/paste special as values macro but am sure there is a
more elegant way of writing the code. what part of the code below is not
necessary?

Sheets("Market").Select
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("A1").Select

Thanks
Kevin

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 82
Default Cleaning up code

Using PasteSpecial.

With Sheets("Market")
.Cells.Copy
.Range("A1").PasteSpecial xlPasteValues
End With

On Jun 22, 6:22*pm, kevin wrote:
Hi I recorded a copy/paste special as values macro but am sure there is a
more elegant way of writing the code. what part of the code below is not
necessary?

Sheets("Market").Select
* * Cells.Select
* * Selection.Copy
* * Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
* * * * :=False, Transpose:=False
* * Application.CutCopyMode = False
* * Range("A1").Select

Thanks
Kevin


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
Cleaning up code Jacob Skaria Excel Programming 0 June 22nd 09 06:28 PM
Cleaning up code Brad Excel Programming 8 June 13th 08 07:50 PM
Cleaning up some code? Patrick[_14_] Excel Programming 3 August 16th 06 12:02 AM
Help Cleaning up Code Lost and Looking for Help Excel Programming 1 May 24th 06 02:26 PM
Need help Cleaning up Code Joel Mills Excel Programming 5 December 16th 04 10:36 PM


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