+ Reply to Thread
Results 1 to 4 of 4

Getting the old value ????

Hybrid View

  1. #1
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello socram_06,

    Do you already have some code written or do you want someone to write a routine to do this? If you have any code wrtitten, please post it.

    Sincerely,
    Leith Ross

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    Socram,

    If you are looking for code to do this, you could insert the following into that sheet's code module (right-click on sheet tab and choose 'View Code'). This will ask the user if they really want to change the value in A1 whenever that cell's value changes, and if not it will revert to the previous value.
    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim ans As String
    Application.EnableEvents = False
        If Target.Address = "$A$1" Then
            ans = MsgBox("Are you sure you want to do this?", vbYesNo, "Warning!")
            If ans = vbNo Then Application.Undo
        End If
    Application.EnableEvents = True
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1