Pete Wright
Member
Hello everybody!
I have a problem with Excel VBA code, that should select and copy the text of a TextBox to clipboard.
As you can see on the screenshot below I have a workbook with two sheets.
The first sheet contains the generated data and the second sheet contains a TextBox which is filled with the data via VBA.
The buttons which "create" and "clear" the data work just fine. The problem is with the "copy" button.
I named the sheet "script" and the TextBox "output"
Now I want to select & copy the text with a button.
I already searched the internet and other forums, but nothing I found worked as expected.
What am I doing wrong? Does anyone have a solution?
Kind regards
Pete Wright
I have a problem with Excel VBA code, that should select and copy the text of a TextBox to clipboard.
As you can see on the screenshot below I have a workbook with two sheets.
The first sheet contains the generated data and the second sheet contains a TextBox which is filled with the data via VBA.
The buttons which "create" and "clear" the data work just fine. The problem is with the "copy" button.
I named the sheet "script" and the TextBox "output"
Now I want to select & copy the text with a button.
I already searched the internet and other forums, but nothing I found worked as expected.
Code:
With script.output 'script = Worksheet, output = TextBox
.SelStart = 0
.SelLength = Len(.Text)
End With
What am I doing wrong? Does anyone have a solution?
Kind regards
Pete Wright