Link to home
Start Free TrialLog in
Avatar of Andreas Hermle
Andreas HermleFlag for Germany

asked on

Copy into the clipboard and paste from clipboard into cell of currently selected table.

Dear Experts:

I would like to incorporate two code snippets in a couple of macro codes. I wonder whether you could help me out with then.

Code snippet 1:
A number with the following make-up (##-###-##-##) is to be selected in cell (15,1) of the currently selected table and copied into the clipboard.

Code snippet 2:
The clipboard is to be emptied and pasted into the currently selected table ...
in cell (16,2) after the 28th character.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas
Avatar of ragnarok89
ragnarok89

You could just turn on Macro recording, perform the actions you describe, and then turn off Macro recording. A module would auto created containing the code version of the actions you just performed. You could then tweak it to your liking.

Al
Avatar of Andreas Hermle

ASKER

Dear ragnarok89:

Thank you very much for your swift answer. I am aware that I could record it, but - to be honest with you - I would like a professional solution. The macro recorder often records things that in a strict programmer sense is no good.

Regards, Andreas
Dear all:

only code snippet 2 is relevant. In the meantime I found a solution for code snippet 1.

Here again my requirements for the code snippet:

The clipboard is to be emptied and pasted into the currently selected table ...
in cell (16,2) after the 28th character.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas
Can you give me an example?

Sid
ASKER CERTIFIED SOLUTION
Avatar of SiddharthRout
SiddharthRout
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Please replace "Sheet1" with the respective Sheet Name.

Sid
SOLUTION
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Sid,  

thank you very much for your quick support.  I guess there must be some understanding here. My question refers to a Word problem. You are referring to Excel in your post.
But thank you anyway for the  time taken.

Regards,  Andreas
Hi Sagib:

thank  you very much for your swift help. This link is a valuable resource, thank you. But, as a matter of  fact, my question is a word problem not an Excel problem.

Thank you.

Regards, Andreas
You can make it work in Word by adding a reference to microsoft forms.

To do that, in VBA, go to

tools > references > browse

and select

c:\windows\system32\FM20.DLL

and make sure that microsoft forms 2.0 is in the list and checked.

Saqib
Andreas: My apologies for not checking that but then again the logic remains the same in word table as well.

Directly assign the value from one cell of the table to the another. You don't need a clipboard for it.

Sid
Hi,

thank you very much to both of you for your professional. Regards, Andreas