Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro to copy a cell value and paste it to the clip board


Hello Everybody,

I want to create a macro to copy the cell value (on select) from the table box and paste it to the clipboard.

Please suggest.

Thanks In Advance

Sonali

1 Solution

Accepted Solutions
jerrysvensson
Partner - Specialist II
Partner - Specialist II

ActiveDocument.GetSheetObject("CH01").CopyValuesToClipboard

Will not work in WebView (Ajax), only in plugin.

View solution in original post

8 Replies
ali_hijazi
Partner - Master II
Partner - Master II

why do you need a macro when you can right-click and select copy->cell value?

I can walk on water when it freezes
Not applicable
Author

Hi Ali,

Yes, there is the option of coping a value, right click- copy- cell value- paste

But I want to reduce the number of actions performed. Hence I want to create a trigger so that when I click a field value it will automaticall copy the selected value.

jerrysvensson
Partner - Specialist II
Partner - Specialist II

ActiveDocument.GetSheetObject("CH01").CopyValuesToClipboard

Will not work in WebView (Ajax), only in plugin.

ali_hijazi
Partner - Master II
Partner - Master II

but you need to pay attention that macros do not work in browsers like google Ghrome and in IE unless you have the IE plug in installed

I can walk on water when it freezes
jerrysvensson
Partner - Specialist II
Partner - Specialist II

>but you need to pay attention that macros do not work in browsers like google Ghrome and in IE unless you have >the IE plug in installed

This is incorrect.

All macros does not work in Ajax, but a lot of them.

CopyValuesToClipboard does not work since you can't access the clipboard in Ajax.

Not applicable
Author


Hi Jerry,

Thanks for your help..

I am using IE plug In for this work but still it is not working.

What will be the actual code?

ActiveDocument.GetSheetObject("CH01").CopyValuesToClipboard

Or do I have to create a variable and pass this variable under Sub  End Sub

jerrysvensson
Partner - Specialist II
Partner - Specialist II

It should work if your tablebox has the ID CH01.

I tested it in Developer and it worked fine, can't try it in plugin since we only use Ajax as client.

sudarshandagar
Contributor
Contributor

Hi, Thanks for the solution, can you please advise a way by which I can copy data with Header. I used below code

Sub Copy

ActiveDocument.GetSheetObject("CH01").CopyValuesToClipboard

End sub