Results 1 to 9 of 9

How to Design a Macro to Copy/Paste Specific Columns to Another Sheet in Specific Columns

Threaded View

  1. #1
    Registered User
    Join Date
    04-01-2013
    Location
    Dallas, TX
    MS-Off Ver
    Excel Pro 2010
    Posts
    6

    How to Design a Macro to Copy/Paste Specific Columns to Another Sheet in Specific Columns

    I am trying to design a Macro to Copy/Paste value and formatting from one sheet that is linked to other workbooks already into another worksheet that can then include other formulas, formatting and have a sort list to change the order of the data ect.

    - Select Specific Columns (max 500 rows of data needed) from the Summary Sheet
    - Copy to the Well Stats tab into specific columns that will be in a different order than in the Summary Sheet and will need some columns in between that won't be copied but will instead perform their own calculations


    This is the code that I have started but I'm afraid that it will run very slowly once I actually setup 20-30 columns to copy/paste over. Is there a simpler code? I have attached my excel sheet. Thanks in advance!

    Code:
    Sub CopyCells()
    '
    ' CopyCells Macro
    
    
        Sheets("Summary Sheet").Select
        Range("G2:G500").Select
        Selection.Copy
        Sheets("Well Stats").Select
        Range("A3").Select
        ActiveSheet.Paste
        Range("A3").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
        Sheets("Summary Sheet").Select
        Range("F2:G500").Select
        Selection.Copy
        Sheets("Well Stats").Select
        Range("B3").Select
        ActiveSheet.Paste
        Range("B3").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
        Sheets("Summary Sheet").Select
        Range("O2:G500").Select
        Selection.Copy
        Sheets("Well Stats").Select
        Range("C3").Select
        ActiveSheet.Paste
        Range("C3").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    End Sub
    Attached Files Attached Files
    Last edited by davesexcel; 04-02-2013 at 07:09 PM. Reason: code tags required

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1