Copying text from a cell using a macro

Posted on 2007-08-02
Last Modified: 2013-11-25
How can I copy text from a cell using a macro and paste the text into an input box?
Question by:kamunya
    LVL 59

    Accepted Solution

    inputbox.text = worksheets("SHEETNAME").range("a1")

    Is a full copy, however with a bit more work you can copy bits and pieces as you wish

    LVL 59

    Assisted Solution

    by:Chris Bottomley
    If it's unclear can you identify the name of the textbox and the worksheet/cell and how data is to be selected/mixed from any sources.

    LVL 10

    Assisted Solution

    Private Sub CommandButton1_Click()

    Dim Cell
    Cell = Range("A1").Value
    InputBox "This is the contents of Cell A1", "Cell Contents", Cell
    End Sub

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
    This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

    754 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