Excel - Copy Values

CROY1985

Well-known Member
Joined
Sep 21, 2009
Messages
501
Office Version
  1. 365
Platform
  1. Windows
Hi all

I know we can paste values in excel, but is there any way to copy values?

I.e have some numbers formatted as 0.0k so 1200 would show as 1.2k, i want to copy the value of that cell (1200) into a google sheet, but what goes into google sheet is 1.2k as a text string.

In the above example if i drop the k, it does get imported as a number but only 1.2.....not the 1200.

Thanks
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Only way I can think of is via VBA by adding the value of the cell to the clipboard
 
Upvote 0
I have this code in sheets where I need to copy codes etc... It allows the user to double click a cell which automatically copies the contents to the clipboard.

If you have several sheets then you can place the CopyToClipboard sub in a Module then you just need the doubleclick event code in each sheet you want it to work on (or just once in the 'Workbook' object). Can be modified to only work with specific cells too.
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    CopyToClipboard Target.Value
    Cancel = True
End Sub


Sub CopyToClipboard(Text As String)
    Dim MSForms_DataObject As Object
    Set MSForms_DataObject = CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
    MSForms_DataObject.SetText Text
    MSForms_DataObject.PutInClipboard
    Set MSForms_DataObject = Nothing
End Sub
 
Last edited:
Upvote 0
Looks good, will give that a try next week (it's too late on friday afternoon to think!)

Thank you
 
Upvote 0

Forum statistics

Threads
1,224,071
Messages
6,176,197
Members
452,714
Latest member
streamer1234

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top