Coding Help Required

syed_mushraf

Active Member
Joined
Oct 13, 2002
Messages
261
Dear Sirs,

I am new i VB coding plz help me.

I want to store any copied text(Ctrl+C) in a variable and whenever I press Ctrl+V it should be paste from the variable.

What coding should I use get the result.

Thankx in advance.
Rgds,
Musharraf
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi Musharraf ,

I think I must be missing the point of your post - isn't the 'variable' that you describe exactly the function that the clipboard performs?

Would you provide a little more detail?
 
Upvote 0
Dear Richi,
Actually I have the following set of coding that is change the color when cell pointer moves.

Problem is that when I copy a cell it does not stored on the clipboard. thats why when I paste it any other location it does not works.

I want to define any variable with this coding and when I press copy or Ctrl+C the text should be stored in this variable.

I want to define another function in my coding that will help me when I will press Paste or Ctrl+V.


Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Excel.Range)
Static oldrange As Range
On Error Resume Next
Target.Interior.ColorIndex = 6
oldrange.Interior.ColorIndex = xlcolorindexname
Set oldrange = Target

End Sub
 
Upvote 0

Forum statistics

Threads
1,215,051
Messages
6,122,872
Members
449,097
Latest member
dbomb1414

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