• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA code is clearing my undo stack

Wulluby

Member
Howdy Chandooins,

Anyone know how I can stop this code from clearing my undo stack? The code is in a sheet and is used to determine which picture to display when a user selects a number from a drop down.

If there is now way round it I can have it attached to a button that the user will have to remember and use when changing the value but it would be good if I could remove that interaction.

Thanks in advance

Code:
Option Explicit
  Private Sub Worksheet_Calculate()
  Dim oPic As Picture
  Me.Pictures.Visible = False
    
  With Range("G10")
  For Each oPic In Me.Pictures
  If oPic.Name = .Text Then
  oPic.Visible = True
  oPic.Top = .Top
  oPic.Left = .Left
  Exit For
  End If
  Next oPic
  End With
  
  End Sub
 
Back
Top