Copy Excel Cell Contents to the Windows Clipboard Faster
Question details
The user needs a faster way to copy formula text from an Excel cell into another formula bar.

- Product
- Microsoft Excel
- Device & OS
- Windows
- Scenario
- The user reviews many formulas stored as text and repeatedly copies individual cell contents into another formula bar.
- Observed behavior
- The current process requires entering cell edit mode, selecting the contents, copying them, and exiting edit mode.
Identify a cell containing the formula text you want to copy. To use the macro, Excel must allow VBA macros and have the Microsoft Forms 2.0 Object Library available.
Use a VBA macro to copy the selected cell's text
Use this method to copy one cell's formula or value to the Windows clipboard without entering cell edit mode.
The macro copies the selected cell's formula if it contains a formula; otherwise, it copies the underlying value, including a formula stored as text. It does not change the source cell.
In Excel, press Alt+F11. Select the workbook in the Project pane, then choose Insert > Module.
In the VBA editor, choose Tools > References, select Microsoft Forms 2.0 Object Library, and click OK. If it is not listed, try Insert > UserForm, then check References again.
Paste this code into the module: Sub CopyCellText() Dim cell As Range Dim clip As New MSForms.DataObject Dim textToCopy As String If TypeName(Selection) <> "Range" Then Exit Sub If Selection.CountLarge <> 1 Then MsgBox "Select one cell." Exit Sub End If Set cell = Selection If IsError(cell.Value2) And Not cell.HasFormula Then MsgBox "The selected cell contains an error value." Exit Sub End If If cell.HasFormula Then textToCopy = cell.Formula Else textToCopy = CStr(cell.Value2) End If clip.SetText textToCopy clip.PutInClipboard End Sub
Return to Excel, select one source cell, press Alt+F8, select CopyCellText, and click Run. You can also use Options in the Macro dialog to assign a shortcut key.
Select the destination cell, click its formula bar, and press Ctrl+V. Review the pasted text before pressing Enter.

Copy all text from the formula bar
Use this option when you cannot run macros and want to select the cell contents without dragging over the text.
Copy Cell Contents with WPS Spreadsheets
Use the formula bar in WPS Spreadsheets to select and copy a cell's text, then paste it into another formula bar.
- 1. Open the workbook: Open WPS Spreadsheets and use File > Open to select your workbook.
- 2. Select the source: Click the cell containing the formula text, then click inside the formula bar.
- 3. Copy the contents: Press Ctrl+A to select the formula bar text, then press Ctrl+C. Press Esc to leave the source cell unchanged.
- 4. Paste into the destination: Select the destination cell, click its formula bar, and press Ctrl+V. Check the text and press Enter.

Frequently Asked Questions
Can I copy a formula stored as text with the macro?
Yes. Select the cell and run CopyCellText through Alt+F8 or its assigned shortcut. The macro copies the cell's underlying text to the clipboard.
Will the macro change the source cell?
No. It reads the selected cell's formula or value and puts the text on the clipboard without editing the worksheet.
Can the macro copy several selected cells at once?
No. This example requires exactly one selected cell. Select an individual cell before running it, including when working with filtered rows.
Why don't cell references adjust when I paste the copied formula text?
The macro copies a text string rather than performing a normal Excel cell copy. Review and update references in the destination formula bar if needed.
What if Microsoft Forms 2.0 Object Library is unavailable?
In the VBA editor, try Insert > UserForm and then look under Tools > References again. If the library is still unavailable, use the formula bar method instead.




