
Cells(thisRow + 1, ActiveCell.Column).ActivateĪpplication.OnRepeat "Move One Row Up", "MoveOneRowUp" 'updates Repeat actionĪpplication. Rows(thisRow + 0).EntireRow.Delete 'remove initial row Rows(thisRow + 2).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromRightOrBelow Rows.Count Then 'check upper & lower bounds If thisRow > 2 And thisRow 1 And thisRow <. You do not need to clear your clipboard, separately for any of the applications on Mac. Simply opt for any of the three clipboard-clearing methods we discussed above and get rid of the clipboard residue. These subs will allow you to use the Ctrl + Z (Undo) and Ctrl + Y (Redo) shortcuts: Similar to Microsoft Excel, you don’t need to do anything extra to clear the Google Chrome clipboard. Rows(rowCurrent - 1).Value = rowContents2 RowContents1 = Rows(rowCurrent - 1).Value ' Copy row contents to variants then copy back reversed ' can be held in an integer variable is 32767 so make sure your worksheets Perhaps more importantly, the maximum value that ' Integer specifies a 16-bit variable which requires special (=slow) processing Sheets in New Workbook: The spinner sets the number of blank worksheets a new workbook will have by default. When you have an inkling or thought about a setting you want to change, just type into the Search field. This macro does not copy any formatting but if all rows are formatted the same, this may be adequate. Choose ExcelPreferences from the menu bar to display the Preferences dialog. According tp my tests this does not clear the clipboard. The macro below copies the two rows to variables then copies the values back reversed. This moved the current row up one as you require but cleared the clipboard. I tried a macro which copied row(current – 1) to a spare row, copied row(current) to row(current – 1), copied the spare row to row(current) and then cleared the spare row. I do not know if Excel uses the clipboard itself or if it automatically clears the clipboard if you perform certain actions. I believe you should avoid attempting that approach until you are convinced no other approach will given you what you wantĪ problem with trying to run a macro without changing the clipboard is that Excel clears the clipboard without you copying anything. The clipboard could contain allsorts of complicated things so a reliable method of saving any contents would be at best difficult. What could I do in the described case to preserve the clipboard history regardless of macro executions? Is there some hint about how the clipboard history mechanism of EXCEL generally works?

But after macro execution, all the clipboard history is gone and I can't reverse anything anymore.
#Set microsoft excel for mac to retain clipboard windows
On my Windows system, I normally do this by pressing +. Thus enabling the user to reverse / cancel / withdraw what the macro has done and even go further back in global clipboard history. Now, I would expect the clipboard history to stay intact after the macro execution. The macro obviously modifies the clipboard because of selecting, cutting and inserting cell contents. To execute this macro, I set a keyboard shortcut (or a button): In effect, I am thus able to move the selected row upwards row by row and so change its row order relative to the other rows. I use a VBA macro to execute a sequence of several single steps in order to exchange the contents of two rows within my sheet.
