PC Review


Reply
Thread Tools Rate Thread

Cleaning up code

 
 
kevin
Guest
Posts: n/a
 
      22nd Jun 2009

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 With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      22nd Jun 2009

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

 
Reply With Quote
 
norie
Guest
Posts: n/a
 
      22nd Jun 2009
Using PasteSpecial.

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

On Jun 22, 6:22*pm, kevin <ke...@discussions.microsoft.com> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Cleaning up code Jacob Skaria Microsoft Excel Programming 0 22nd Jun 2009 06:28 PM
Cleaning up some code? Patrick Microsoft Excel Programming 3 16th Aug 2006 12:02 AM
Help Cleaning up Code =?Utf-8?B?TG9zdCBhbmQgTG9va2luZyBmb3IgSGVscA==?= Microsoft Excel Programming 1 24th May 2006 02:26 PM
Need help Cleaning up Code Joel Mills Microsoft Excel Programming 5 16th Dec 2004 10:36 PM
Code Cleaning Anthony leong kar keong Microsoft C# .NET 5 7th Nov 2003 06:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:22 PM.