OK, this is a tricky one so please bear with me while I'm struggling to explain.
I got this large Excel table from another department and it contains about 35 columns worth of data, for a total of 150+ thousand rows. Now what they did is mess up some columns between themelves for about 17 thousand worth of rows. I have filtered he offenders out and now I need to perform a set of copy-paste actions on them, basically switching data around in columns.
I know how to copy filtered data (F5, Special, visible cells only) and that works fine. But when actually pasting over into the correct column, things start to mess up.
I have tried the following workarounds:
- simple paste. Does not work, it pastes the source over the entire destination, ignoring rows that are filtered out.
- Use F5, Special, Visible cells only on the destination, which highlights only the cells that I need to paste to, but when pasting I receive "This command cannot be performed on multiple selections". Gaah!
- Devise a macro which simply presses right, left and down keys and copies data around cell by cell. Using cell references didn't really work out well because of all the filtering (I am filtering on more than one column) so i thought I would use the SendKeys command to enforce the cell cursor movement.
Macro below:
The problem is that SendKeys doesn't work. Instead of moving the cursor around, it types some weird text in a cell. The text is "393740".
I am using Excel 2007.
Any help is greatly appreciated. Doing a manual copy/paste over 17 thousand rows would likely take me ages...
I got this large Excel table from another department and it contains about 35 columns worth of data, for a total of 150+ thousand rows. Now what they did is mess up some columns between themelves for about 17 thousand worth of rows. I have filtered he offenders out and now I need to perform a set of copy-paste actions on them, basically switching data around in columns.
I know how to copy filtered data (F5, Special, visible cells only) and that works fine. But when actually pasting over into the correct column, things start to mess up.
I have tried the following workarounds:
- simple paste. Does not work, it pastes the source over the entire destination, ignoring rows that are filtered out.
- Use F5, Special, Visible cells only on the destination, which highlights only the cells that I need to paste to, but when pasting I receive "This command cannot be performed on multiple selections". Gaah!
- Devise a macro which simply presses right, left and down keys and copies data around cell by cell. Using cell references didn't really work out well because of all the filtering (I am filtering on more than one column) so i thought I would use the SendKeys command to enforce the cell cursor movement.
Macro below:
Sub Copy_Over()
'
' Copy_Over Macro
'
'
Application.CutCopyMode = False
Selection.ClearContents
SendKeys vbKeyRight
ActiveCell.Select
Selection.Cut
SendKeys vbKeyLeft
ActiveSheet.Paste
SendKeys vbKeyDown
End Sub
The problem is that SendKeys doesn't work. Instead of moving the cursor around, it types some weird text in a cell. The text is "393740".
I am using Excel 2007.
Any help is greatly appreciated. Doing a manual copy/paste over 17 thousand rows would likely take me ages...