Coding Help Required

syed_mushraf

Active Member
Joined
Oct 13, 2002
Messages
259
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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Richie(UK)

MrExcel MVP
Joined
May 17, 2002
Messages
3,329
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?
 

syed_mushraf

Active Member
Joined
Oct 13, 2002
Messages
259
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
 

Forum statistics

Threads
1,144,273
Messages
5,723,436
Members
422,497
Latest member
dougy99

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
Top