PC Review


Reply
Thread Tools Rate Thread

How to copy a range of cells and paste into a new workbook in differentcolumns

 
 
Mas
Guest
Posts: n/a
 
      16th Aug 2011
Hi all,

I have created a macro that copies and a number of columns and pastes
them in a new workbook in a variety of columns but the macro look
unprofessional as it flickers between copying column A and paste in
column A of the new workbook, copy column C and paste in column B, etc.

I would like to copy a range i.e. column A, C, D, F, G in the open
workbook and paste in a new workbook in columns A, B, F, G, H. without
all the flicker between workbooks etc.

Appreciate any help I can get.
 
Reply With Quote
 
 
 
 
Pete_UK
Guest
Posts: n/a
 
      16th Aug 2011
Put this line near the beginning of your macro:

Application.ScreenUpdating = False

and then after you have done all the copy/paste operations insert this
line near the end:

Application.ScreenUpdating = True

This will prevent the flicker as you switch between different sheets,
by not updating the screen display until you have finished. It will
also speed up your macro, though you might not notice this.

Hope this helps.

Pete

On Aug 16, 10:45*am, Mas <n...@company.com> wrote:
> Hi all,
>
> I have created a macro that copies and a number of columns and pastes
> them in a new workbook in a variety of columns but the macro look
> unprofessional as it flickers between copying column A and paste in
> column A of the new workbook, copy column C and paste in column B, etc.
>
> I would like to copy a range i.e. column A, C, D, F, G in the open
> workbook and paste in a new workbook in columns A, B, F, G, H. without
> all the flicker between workbooks etc.
>
> Appreciate any help I can get.


 
Reply With Quote
 
Gord
Guest
Posts: n/a
 
      16th Aug 2011
Not using "select" will speed things up also.

A recorded macro will give you this................

Columns("B:B").Select
Selection.Copy
Sheets("Sheet6").Select
Range("C1").Select
ActiveSheet.Paste

The equivalent is this with no screen flicker......................

Columns("B:B").Copy Destination:=Sheets("Sheet6").Range("C1")


Gord Dibben Microsoft Excel MVP

On Tue, 16 Aug 2011 19:45:18 +1000, Mas <(E-Mail Removed)> wrote:

>Hi all,
>
>I have created a macro that copies and a number of columns and pastes
>them in a new workbook in a variety of columns but the macro look
>unprofessional as it flickers between copying column A and paste in
>column A of the new workbook, copy column C and paste in column B, etc.
>
>I would like to copy a range i.e. column A, C, D, F, G in the open
>workbook and paste in a new workbook in columns A, B, F, G, H. without
>all the flicker between workbooks etc.
>
>Appreciate any help I can get.

 
Reply With Quote
 
Gord
Guest
Posts: n/a
 
      16th Aug 2011
Or this if all you need is values.

Sheets("Sheet6").Range("C:C").Value = _
Worksheets("Sheet1").Range("B:B").Value


Gord

On Tue, 16 Aug 2011 06:49:57 -0700, Gord <(E-Mail Removed)> wrote:

>Not using "select" will speed things up also.
>
>A recorded macro will give you this................
>
>Columns("B:B").Select
> Selection.Copy
> Sheets("Sheet6").Select
> Range("C1").Select
> ActiveSheet.Paste
>
>The equivalent is this with no screen flicker......................
>
>Columns("B:B").Copy Destination:=Sheets("Sheet6").Range("C1")
>
>
>Gord Dibben Microsoft Excel MVP
>
>On Tue, 16 Aug 2011 19:45:18 +1000, Mas <(E-Mail Removed)> wrote:
>
>>Hi all,
>>
>>I have created a macro that copies and a number of columns and pastes
>>them in a new workbook in a variety of columns but the macro look
>>unprofessional as it flickers between copying column A and paste in
>>column A of the new workbook, copy column C and paste in column B, etc.
>>
>>I would like to copy a range i.e. column A, C, D, F, G in the open
>>workbook and paste in a new workbook in columns A, B, F, G, H. without
>>all the flicker between workbooks etc.
>>
>>Appreciate any help I can get.

 
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
Copy Range, Paste Value in New Workbook BaggieDan Microsoft Excel Programming 2 21st Oct 2009 02:32 PM
Column range to search from a source workbook and then copy/paste DanS Microsoft Excel Programming 0 10th Feb 2009 11:29 PM
Copy paste a range from one Workbook to another Kc-Mass Microsoft Excel Programming 2 13th Dec 2006 01:18 AM
Need a macro to copy a range in one workbook and paste into another workbook Paul Microsoft Excel Programming 8 1st Jul 2004 07:42 AM
Copy a range of cells in an unopened workbook and paste it to the current workbook topstar Microsoft Excel Programming 3 24th Jun 2004 12:50 PM


Features
 

Advertising
 

Newsgroups
 


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