[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

MS Excel - Selected Copy Paste

Posted on 2013-01-30
2
Medium Priority
?
236 Views
Last Modified: 2013-02-17
I wish to do selective copy paste from one file to another:

Copy Column A:F from Sheet 1

Paste on Sheet 2, so that

Sheet 1                          Sheet 2
Values of Column A = Values of Column A
Values of Column B = Values of Column C
Values of Column C = Values of Column E ... and so on.

unable to use visible cells only copy paste option. plz. help.

regards.
0
Comment
Question by:peeyushmiglani
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 46

Expert Comment

by:aikimark
ID: 38838244
Your choices seem to be:
* do a regular copy/paste and insert a new column B in sheet 2.

* do two copy/paste operations

* implement a direct value copy with two VBA statements
0
 
LVL 14

Accepted Solution

by:
Faustulus earned 1500 total points
ID: 38846123
Please try this code:-
Option Explicit

Sub TransferData()

    Dim WsT As Worksheet            ' Target sheet
    Dim WsS As Worksheet            ' Source sheet
    Dim C As Long                   ' Source column
    
    Set WsS = Sheets("Sheet1")
    Set WsT = Sheets("Sheet2")
    Application.ScreenUpdating = False
    
    For C = 6 To 2 Step -1         ' insert columns
        WsS.Columns(C).Insert
    Next C
    
    With WsS
        Range(.Columns(1), .Columns(11)).Copy Destination:=WsT.Cells(1, 1)
    End With
    
    For C = 2 To 6                 ' delete blank columns
        WsS.Columns(C).Delete
    Next C
    Application.ScreenUpdating = True
End Sub

Open in new window

I think it should accomplish what you wish to do.
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question