Excel macro to multiply the conects of a column by 1

Posted on 2011-10-28
Last Modified: 2012-08-14
I want to convert the contents of a column to numbers by a special Paste > Multiply by 1.
Currently the macro copies the cell Z1 (which contains "1") and does the Special Paste. Is there a way I can do this without copying the 1 from a cell contents?
Question by:RTsal
    LVL 29

    Accepted Solution

    Substitute the range for ActiveCell

    ActiveCell.FormulaR1C1 = ActiveCell.Value

    LVL 26

    Expert Comment

    Hi, RTsal.

    The following code put a value (3.1415926 in this case - just change it to 1) in the clipboard without needing a cell.
    Sub Clipboard_Demo()
    ' Needs a reference to "Microsoft Forms 2.0 Object Library"
    Dim xDataObject As dataObject
    Set xDataObject = New dataObject
    xDataObject.SetText 3.1415926, 1
    Set xDataObject = Nothing
    End Sub

    Open in new window

    Please note that a reference to "Microsoft Forms 2.0 Object Library" is required. Let me know if you need to know how to do that.

    LVL 50

    Expert Comment

    This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
    LVL 26

    Expert Comment

    teylyn, agreed.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
    How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
    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 demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

    760 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

    6 Experts available now in Live!

    Get 1:1 Help Now