I have made use of the _KeyDown function in my windows form:
if ((e.KeyCode == Keys.V) && (e.Modifiers == Keys.Control))
{
// do stuff
}
and then have used to get the copied data:
string[] clipboardRows = Clipboard.GetText(TextDataFormat.UnicodeText).Split(new string[] {"\r\n"},
StringSplitOptions.None);
This works fine, however when you select say selected cells from a spreadsheet it ends up copying all cells in between for example:
1.Test
2.Test2
3.Test3
4.Test4
If i select both test and test 4 using ctrl and then copying by pressing C, when pressing ctrl + v and stepping through it gets all in between so test2 and test3.
How do i resolve this?
I’ll show you why you cant do it. I recorded a Macro in Excel, entered four rows of data. I selected cell A1 and A4, press Ctrl + C
You can do this in VSTO eg Copy & Paste VSTO – Excel Power Tools, but thats another question.