redspanna
Well-known Member
- Joined
- Jul 27, 2005
- Messages
- 1,577
- Office Version
-
- 365
- Platform
-
- Windows
Hello all
I have below code placed into the 'audit' sheet which I want to initialize the Userform1 if cell D8 is activated
However I also have some other code that clears all old data from a range of cells including D8 - so once this code is run it activates the userform.
I only want the userform to be activated when the user inputs a value into cell D8 NOT when the code used clears the cell of old data
Any ideas how to adapt above code so this happens
Many thanks in advance
I have below code placed into the 'audit' sheet which I want to initialize the Userform1 if cell D8 is activated
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Set KeyCells = Sheets("Audit").Range("D8")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
Userform1.Show
End If
End Sub
However I also have some other code that clears all old data from a range of cells including D8 - so once this code is run it activates the userform.
I only want the userform to be activated when the user inputs a value into cell D8 NOT when the code used clears the cell of old data
Any ideas how to adapt above code so this happens
Many thanks in advance