Copy & Paste Macro

Posted on 2011-10-09
Last Modified: 2012-08-13
Hi Experts;

I want to create a macro can work with any sheet or excel work sheet.
The macro is working like :
1- after I select a specifc cells.
2- I run the macro; a pop up window asks me clomn and row number where to paste the value only.
3- end of macro.

pls make your example in a work sheet.

thank you.
Question by:obad62
    1 Comment
    LVL 9

    Accepted Solution

    Please find attached sample Excel File and given below is the Macro Code

    Sub CopyPasteValues()
    ' CopyPasteValues Macro
    ' Use this Macro to Copy Values from Selected Cells to a specified Cell
        Dim DestCell
        DestCell = InputBox("Specify Destination Cell")
        If DestCell <> "" Then
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        End If
    End Sub

    Open in new window


    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Join & Write a Comment

    This article will show, step by step, how to integrate R code into a R Sweave document
    This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
    The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
    The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now