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
 

Some videos you may like

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,761
Office Version
2013
Platform
Windows
Assuming you just want to copy the values of the active cell use this:
Code:
Sub Copy_Values()
ActiveCell.ClearFormats
ActiveCell.Copy
End Sub
 

bhupender

New Member
Joined
Sep 24, 2013
Messages
17
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
 

bhupender

New Member
Joined
Sep 24, 2013
Messages
17
F2 gets the cells into edit mode and then you can copy the content of the cell.
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,761
Office Version
2013
Platform
Windows
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.
 

bhupender

New Member
Joined
Sep 24, 2013
Messages
17
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.
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,761
Office Version
2013
Platform
Windows
Have you tried what I posted and found it does not work?
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,761
Office Version
2013
Platform
Windows
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,099,332
Messages
5,467,987
Members
406,562
Latest member
Isbenji

This Week's Hot Topics

Top