BobTheSpreadsheetBuilder
New Member
- Joined
- Nov 23, 2023
- Messages
- 6
- Office Version
- 2016
- Platform
- Windows
Hi, I have a simple task to do but my attempts seem to just result in pasting a line of vba into the destination cell, instead of the value selected.
You can see in the attached image that I have a button to click on (with attached subroutine), a string of words in one cell, only one of which is selected, and a destination cell.
Now, I can press CTRL+C with my left hand before clicking the button (with a paste script) to achieve this.
However as I expect to do this many times, I wish for a script that will accomplish the CTRL+C part and allow me to paste the selected word in one click.
I have tried using SendKeys but its not working correctly. As you can see in this example, instead of pasting "primary", it pasted a vba code line "Application.SendKeys"
Does anyone have any scripting knowledge that can make this work ? Any advice is greatly appreciated
Bob
You can see in the attached image that I have a button to click on (with attached subroutine), a string of words in one cell, only one of which is selected, and a destination cell.
Now, I can press CTRL+C with my left hand before clicking the button (with a paste script) to achieve this.
However as I expect to do this many times, I wish for a script that will accomplish the CTRL+C part and allow me to paste the selected word in one click.
I have tried using SendKeys but its not working correctly. As you can see in this example, instead of pasting "primary", it pasted a vba code line "Application.SendKeys"
Does anyone have any scripting knowledge that can make this work ? Any advice is greatly appreciated
Bob