Hi all-
I'm completely new to VBA, so please forgive my ignorance. I am trying to have the code run when excel starts (to keep users from being able to cut and paste). If someone wants to be able to cut and paste, they will enter a password and the code will not run- giving the user the ability to cut an paste (i.e. stop the code from running). I don't know how to make this work. Thanks in advance.
Jonathan
Sub GetPassword()
Dim strPassword As String
strPassword = InputBox(Prompt:="Your password please:", _
Title:="ENTER YOUR PASSWORD", Default:="Your Password here")
If strPassword = "Password" Then ??????
If strPassword <> "Password" Or _
strPassword = vbNullString Then
End If
End Sub
Private Sub Workbook_Activate()
Application.CutCopyMode = False
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
End Sub
Private Sub Workbook_Deactivate()
Application.CellDragAndDrop = True
Application.OnKey "^c"
Application.CutCopyMode = False
End Sub
Private Sub Workbook_WindowActivate(ByVal Wn As Window)
Application.CutCopyMode = False
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
End Sub
Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
Application.CellDragAndDrop = True
Application.OnKey "^c"
Application.CutCopyMode = False
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Application.CutCopyMode = False
End Sub
I'm completely new to VBA, so please forgive my ignorance. I am trying to have the code run when excel starts (to keep users from being able to cut and paste). If someone wants to be able to cut and paste, they will enter a password and the code will not run- giving the user the ability to cut an paste (i.e. stop the code from running). I don't know how to make this work. Thanks in advance.
Jonathan
Sub GetPassword()
Dim strPassword As String
strPassword = InputBox(Prompt:="Your password please:", _
Title:="ENTER YOUR PASSWORD", Default:="Your Password here")
If strPassword = "Password" Then ??????
If strPassword <> "Password" Or _
strPassword = vbNullString Then
End If
End Sub
Private Sub Workbook_Activate()
Application.CutCopyMode = False
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
End Sub
Private Sub Workbook_Deactivate()
Application.CellDragAndDrop = True
Application.OnKey "^c"
Application.CutCopyMode = False
End Sub
Private Sub Workbook_WindowActivate(ByVal Wn As Window)
Application.CutCopyMode = False
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
End Sub
Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
Application.CellDragAndDrop = True
Application.OnKey "^c"
Application.CutCopyMode = False
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Application.CutCopyMode = False
End Sub