VBA command for copying active cell content only

bhupender

New Member
Joined
Sep 24, 2013
Messages
17
Hello folks,
I tried the whole internet but couldnt find vba code for.
selecting active cell , then
f2 command, then
selecting all the content of the cell, then
copy all the content.

I have to enter a lot of data from excel to external application which support only values and not normal data copied from excel.

Please help, it looks easy, but doesnt have much knowledge of vba.

thanks
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Assuming you just want to copy the values of the active cell use this:
Code:
Sub Copy_Values()
ActiveCell.ClearFormats
ActiveCell.Copy
End Sub
 
Upvote 0
Thanks for the reply mate. But in my case it doesn't serve the purpose. This command will work fine excel but for pasting value in external application I need to copy it using F2 > select all cell content > and then copy (I don't know why it doesn't take simple copy and paste).
So, I will be needing some code which can replicate these keyboard keys commands.

thanks


Assuming you just want to copy the values of the active cell use this:
Code:
Sub Copy_Values()
ActiveCell.ClearFormats
ActiveCell.Copy
End Sub
 
Upvote 0
With Vba you do not need to press F2 every time you want to copy a cell value.
I've been using Vba for years.
 
Upvote 0
don't know, but I have noticed in many applications, I have worked with allows values to be paste only when the same is copied after entering into edit mode of the cell.
I am not an expert of excel so doesn't know why it happens.
But anyways, if I can do something with excel, I believe that can be done with VBA as well.
can't you suggest a code that can replicate what I do manually and we'll see what happens.
 
Upvote 0
I do not know what else to tell you.
This is a very simple script which copies the active cells value into the clipboard

If you want a Macro to duplicate your exact commands then I suggest you use the Excel Macro Recorder.

From the main menu choose view then choose Macros at step through the obvious steps.
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,557
Latest member
richa mishra

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