?
Solved

MS Excel - Selected Copy Paste

Posted on 2013-01-30
2
Medium Priority
?
232 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

752 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