What would I have to add to this VBA Code to keep Undo Button working after it runs

0 votes

I was looking for VBA code so that whenever I copy and paste the text into Excel from wherever the formatting will be preserved. To do it, I discovered two distinct codes:

Sub PasteWithDestinationFormatting()
ActiveCell.PasteSpecial (xlPasteAll)
End Sub

and

Sub PasteWithDestinationFormatting()
ActiveSheet.PasteSpecial Format:="Unicode Text", Link:=False, DisplayAsIcon:=False
End Sub

The issue is that while both of them function, they both make it impossible to use the "Undo" button and the "Ctrl + Z" shortcut. I'm attempting to determine the cause of this and what I can do to remedy it.

Dec 16, 2022 in Others by Kithuzzz
• 38,000 points
514 views

1 answer to this question.

0 votes
VBA eliminates Excel's undo function. Though it would be complicated, you could use VBA to construct your own undo.
answered Dec 16, 2022 by narikkadan
• 63,600 points

Related Questions In Others

0 votes
1 answer

What VBA code would I use to concatenate cell A2 & B2 in cell C2 and then have it Autofill down the column?

Solution Find the last row. Write a formula to ...READ MORE

answered Feb 14, 2023 in Others by Kithuzzz
• 38,000 points
1,016 views
0 votes
1 answer
+1 vote
3 answers

What do I have to learn to become a software dev/engineer?

Hey, @Josh, Be Clear About Your End Goal. Software ...READ MORE

answered Jun 30, 2020 in Others by Gitika
• 65,770 points
1,442 views
0 votes
0 answers

Convert Rows to Columns with values in Excel using custom format

1 I having a Excel sheet with 1 ...READ MORE

Feb 17, 2022 in Others by Edureka
• 13,690 points
975 views
0 votes
1 answer

Remove formulas from all worksheets in Excel using VBA

Try this : Option Explicit Sub test1() ...READ MORE

answered Oct 3, 2022 in Others by narikkadan
• 63,600 points
2,019 views
0 votes
1 answer

Calculate monthly average from daily data without PivotTable

Assuming you have the months in column D enter ...READ MORE

answered Oct 3, 2022 in Others by narikkadan
• 63,600 points
1,764 views
0 votes
1 answer

Automate compound annual growth rate (CAGR) calculation

The following PowerPivot DAX formulas worked for ...READ MORE

answered Oct 7, 2022 in Others by narikkadan
• 63,600 points
1,280 views
0 votes
1 answer

How to programmatically code an 'undo' function in Excel-Vba?

Add the command button to the worksheet ...READ MORE

answered Nov 25, 2022 in Others by narikkadan
• 63,600 points
1,034 views
0 votes
1 answer

VBA code to select only a table. I am getting a Run-time error '1004'; Method 'Range' of object'_Global' failed

No copy/paste, just direct assignment use.Value Sub Final_Report() ...READ MORE

answered Jan 13, 2023 in Others by narikkadan
• 63,600 points
1,119 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP