VBA Code For Undo

Nov 26, 2009

A Worksheet_Change macro in Sheet1 changes the font colour if the target is cell(1,1). So, if I change the value of cell(1,1), it will become red. But then I cannot change it back to the original value because the undo button is not active anymore. And what if I changed cell(1,1) by mistake instead of cell(2,1), and I want to put it back to the original value?

View 5 Replies


ADVERTISEMENT

Edit Undo When Using VBA Code

Jul 21, 2006

Is it possible to enable the undo command when using VBA code in a spreadsheet? Right now if someone makes a mistake it can’t be undone.

View 5 Replies View Related

Undo Option Lost After Event Macro Code

May 23, 2008

I have a sales spreadsheet, that people on this forum have very kindly helped me with by giving me two macros; one to remind users that they need to update the month cell when an order comes in, and the other to automatically put the date in a cell when any cell in that row is changed.

The final thread is here: Message To Remind That Cell Is Mandatory

and the Macro used is:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range
Application.EnableEvents = False
For Each c In Target
If c.Column = 11 Then
If c.Value = "100 - Purchase Order In" Then
MsgBox "Is the Month In correct?"
End If
End If
If c.Column > 1 And c.Column < 18 Then
Cells(c.Row, 1) = Now
End If
Next c
Application.EnableEvents = True
End Sub

However...

We've now found that we cannot undo anything in these spreadsheets. If, for example, a cell is incorrectly copied or deleted, the only way of undoing the change is to shut down the spreadsheet without saving!

Is this just a by-product of using the time macro (a search on other threads suggests that it might be), and, if so, is there any way of changing it?

View 9 Replies View Related

Undo Column Name

Apr 1, 2009

How do undo a column name, say you named column "b" boy how do you get it back to b.

View 2 Replies View Related

Undo Action In VBA

Jul 18, 2006

I have a database in excel which I want only selected users to have edit rights & others should have readonly rights. I have written the following code where a pop up would appear in selected cells warning user for editing the said cell. What I want is when a user clicks yes he should be able to edit it & when he clicks no the cell should get protected.

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Dim rTriggerCell As Range
If Not Intersect(Target, Range("D1:D100")) Is Nothing Then
Set rTriggerCell = Target
Application.EnableEvents = True
If MsgBox("Edit Cell?", vbYesNo)
End If
On Error Goto 0
Exit Sub
End If

View 6 Replies View Related

Undo Text To Columns?

Jul 20, 2009

How do I undo text to columns?

I had a list of email addresses that I put into two columns with the @-now I have finished manipulating and I need to have the email addresses whole again.

The email is now in column A and the domain is in column B. I cannot click undo.

View 4 Replies View Related

Undo Last Commad Button

Jan 28, 2009

I need to create an Undo Last command button.

I have created a textbox using the control toolbox and I have created command buttons that populate text when I click them into the text box.

Do you guys know the code for a command button to undo the last entry in the text box.

View 7 Replies View Related

Undo Data Validation

Mar 19, 2012

How can I do the above Title?

View 1 Replies View Related

Unable To Undo / Redo

Apr 16, 2007

I am unable to undo/redo in MsExcel. Have tried to uninstall/reinstall office, all updated are current.

View 9 Replies View Related

Undo Last Action - Userform

Aug 14, 2008

What i have is a userform which contains textboxes a user can enter or change data in.

What i'd like to do is to have a button called something like "undo last" whereby a user can 'swap' back the last change they made.. does anyone have any idea how i might go about it?

View 9 Replies View Related

Increase Undo Limit From 16

Apr 20, 2007

In Dave and Raina Hawley's excellent Excel Hacks book they showed how to increase the undo limit of 16 up to 100. THis only works for EXcel 2002. Any Bright spark know how to do this for Excel 2003?

View 2 Replies View Related

UNDO Feature To Work

Sep 13, 2007

I cannot get the UNDO feature to work.

View 9 Replies View Related

Undo All Users Actions

Sep 20, 2007

Is there a structure inside of Excel which keeps track of all the actions taken by a user (something that would presumably be used to allow for an undo sequence)? If so, is there a way to get access to it?

View 2 Replies View Related

Undo Causes Copy & Paste

Mar 27, 2008

I'm working on a massive Excel sheet which admittedly uses tons of macros, comboboxes and pivot tables. My issue at the moment is that I have no idea why Excel is pasteing values from specific sheets into the current sheet, when I click on 'Undo'. I've only been able to replicate it when i copy, paste and then undo. I've removed code relating to those sheets and it still does it. I also have no macro's using Ctrl+z. The sheet, whose values it's pasting, does use comboboxes. I have changed the linked cell property in Excel to the "SheetName"!"Cell". It still does this. The odd thing is that it doesn't do it to new workbooks or new sheets.

View 9 Replies View Related

Sheet Has Lost The 'UNDO' Facility

Jun 23, 2009

I have created a spreadsheet in the field of marine surveying. In that sheet, I have used a lot of macros (21 modules) and a lot of VBA, most of it provided by kind people on this forum. But what has happened now, is that when I use that particular worksheet, the 'Undo' menu item in the 'Edit' menu has become permanently grayed out and it says 'Can't Undo'.

In other words, I cannot undo, even if I have made the wrong entry in an unprotected cell. If I use any other sheet, or make a new sheet, everything returns to normal. So, is there any way I can re-gain the 'Undo' facility, while using that particular sheet. I am using Excel 2003 on a Windows XP Home (SP3) platform.

View 4 Replies View Related

How To Undo List Hiding Entries

Dec 13, 2012

I keep a client list and excel at random will essentially hide entire rows of entries. For example if I go to search a name from the name column that I know I entered nothing will return but if I specifically enter the cell number that is hidden the information will be show, does excel 2011 have an auto-grouping or hiding feature that I'm not aware of? If so, how do I get rid of it? I'm not sure if this makes a difference but all the numbers to the left most of the sheet are blue where in every other sheet they are gray.

View 2 Replies View Related

Redo / Undo Buttons Are Greyed Out

Aug 9, 2013

In some excel files the redo / undo buttons are grayed out

View 3 Replies View Related

Excel 2003 :: Undo Is Not Working

Nov 12, 2013

why my undo just won't ever work. Excel 2003.

View 1 Replies View Related

Undo Absolute Cell References

Jul 26, 2009

I'm using a lot of "activeCell.offset(row,col).address" type of entries to form formulas for me. All of the references come across as Absolute References - $G$24, for example. Is there a different way for activeCell to give me a "normal" address ('G24' vice '$g$24') or a function that will convert for me?

View 2 Replies View Related

Undo Button Information Box Text

Mar 6, 2013

I'm new to VBA & would like to use the MsgBox() function to display some of the data found in the information pop-up window when a user hovers the mouse over the undo button (e.g. Typing '=ABS(C3)' in C6).

I want to take this text to put it into something like this:

MsgBox("You just " & CODE_FOR_UNDO_TEXT & ".")

This will allow me to remind users of the last action they took.

View 3 Replies View Related

Build Undo In Recorded Macro

Oct 2, 2006

I have recorded certain macros. But after executing macro 'Undo' do not work. How can I do it ?

View 3 Replies View Related

Worksheet_change Event Disables Undo

Jul 4, 2007

I have a user who wanted a spreadsheet to highlight cells containing formulas whenever the formula was changed. (They want the ability to make changes, but want those changes highlighted. They do not want to protect cells with formulas.) I tried to accomplish this with Conditional Formatting but could not figure out a way to do it, so I turned to VBA. I wrote the following routine that is called on the Worksheet_change event:

Sub CheckFormulas(Target As Range, FormulaRange As String)
Dim CurCell As Range
For Each CurCell In Range(FormulaRange)
If Target.Address = CurCell.Address Then
Target.Interior.ColorIndex = 3
End If
Next CurCell
End Sub...................

View 2 Replies View Related

Why Do Some Excel Documents NOT Allow To Undo / Redo When Using Macro

Jul 11, 2013

Some of my Excel files work perfectly in terms of undo/redo, while others simply cannot use that feature. I took a stroll through the internet looking for the answer, but the issues that I found seemed to point to the application losing its ability, which was resolved with a registry edit/update/change. I don't think that's the case here because I CAN undo is SOME documents.

After some investigation with my problem documents I have found that THIS Macro is the one thing all my undo-free documents have in common: [URL]

View 14 Replies View Related

Undo Button Disabled Once Report Opened Containing VBA?

Jun 10, 2014

I do have a VBA that runs in the report. For whatever reason this stops excel back button (or CRTL Z) from working. What would i need to change in order for back button to work?

I know it is due to this VBA since all other spreadsheets are working fine and as soon as i open this spreadsheet undo button stops functioning.

Private Sub Worksheet_Calculate()
Dim MyPic As Picture
Me.Pictures.Visible = False
Pictures("Picture 11").Visible = True
With Range("AH1")
For Each MyPic In Me.Pictures
If MyPic.Name = .Text Then

[code].....

View 1 Replies View Related

Excel 2007 :: Redo And Undo Broken After Save?

Jun 8, 2010

I have Excel 2007.

Undo / Redo - they do NOT work properly after a save. Before a save, its great - I can undo / redo many many changes.

After a save, I can only undo 2 changes, but the worst thing is it ONLY REDOES ONE of them.

I work by saving very regularly, then I go and look at something on the sheet, and then use Undo / Redo to get back to where I was last updating the sheet and see what I had just been working on, especially if its a few minutes in between.

However, when I do that now, it undoes my last change, but the redo has been lost. So I do:

change, save, undo, redo

and it just doesn't do the redo. The redo button is greyed out.

If I do:

change, change, save, undo, undo, redo, redo

the first redo works, and the second fails as the redo has been lost.

It seems pretty basic that undo / redo should be symmetrical but they aren't, at least now.

I would rather just not have undo after save at all than this broken version.

Why are they putting so much stuff in Excel but they can't even get one of the most basic parts of spreadsheets correct - such as undo / redo, and the ability to open independent spreadsheets without having to change things in the registry (which I have had to do so I can work on two spreadsheets in a semi-sane fashion, undo being shared across your sheets otherwise). MS needs a back to basics...

View 5 Replies View Related

Excel 2013 :: Enabling Undo After Running A Macro?

Mar 18, 2014

A coworker just ran something by me that i'm quite frankly baffled by. After running a macro, the undo function becomes disabled up to the point of when the macro was ran. I've done a quick search through the forums and can't seem to find this question so i thought i'd ask.

Is there an option to toggle somewhere or 3rd party addon that keeps Undo enabled after running a macro? On a similar topic for my own curiosity, what's the reason that it disables?

View 3 Replies View Related

Restore Excel Undo History After Running Macro?

Jun 11, 2014

I managed to implement a macro that adds a time/date stamp in Column A when any of the subsequent cells in that row are changed. With this now working, I really need the ability to restore the undo history in case a change to the data needs to be reverted.

Sub procedure:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range
Application.EnableEvents = False
For Each c In Target
If c.Column > 1 And c.Column < 21 Then
Cells(c.Row, 1) = Now
End If
Next c
Application.EnableEvents = True
End Sub

View 2 Replies View Related

Undo The Column Hide & Stop On Delete Sheet

Jan 26, 2007

I have a file without password (on file there is sheet protection) & file in shared base with 31 sheets.

User can't do following things :

1. User can't Hide column and can't make a change in column width
2. User Can't delete any sheet from file.

if user do the above thing then undo the event or stop the above event.

This file is on shared mode and i don't want to use sheet protection

View 6 Replies View Related

2002 Code V 97 Code: Add A Small Workbook Open Event Code Which Works For Me But Debugs For The Others

Jan 27, 2009

I use excel 2002 but some of my office are on 97, i want to add a small workbook open event code which works for me but debugs for the others?? The code is basically, go to a tab, on that tab and that range sort..

View 2 Replies View Related

Cracked Vb Code: Prevent People From Accesing The Code I Protected The Code Blocking It From Visualization

Feb 8, 2007

I've developed a little software using Excel Macros & VB. To prevent people from accesing the code I protected the code blocking it from visualization. It seems not enough as an acquaintance of a friend cracked it in 25 minutes. Or so he says. So I'd like to know if there is a better way to protect the font code.

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved