ndendrinos
10-13-2008, 04:19 PM
Sub test()
'this sub is only present to demonstrate use of the function!
'it is not required to use the function.
Dim r As Range, retVal, sKey As String
sKey = Application.InputBox("Enter your key", "Key entry", "My Key", , , , , 2)
retVal = MsgBox("This is the key you entered:" & vbNewLine & Chr$(34) & sKey & Chr$(34) & vbNewLine & _
"Please confirm OK or Cancel to exit", vbOKCancel, "Confirm Key")
If retVal = vbCancel Then Exit Sub
For Each r In Sheets("Sheet1").UsedRange
If r.Interior.ColorIndex = 6 Then
r.Value = XorC(r.Value, sKey)
End If
Next r
End Sub
I need help in adapting above by Richard Schollar/mdmackillop like this:
After the customer has filled the details of his credit card number [D48] and by a change event of that one cell (no need for a Command Button) the routine runs and encrypts the number.
I would like to delete the part that runs the code on "yellowed" cells .... rather restrict it to cell D48
If possible I will then try to add further code to the routine to kill the routine itself in the VBA editor and save the file.
My goal: The customer emails me his order with his credit card encrypted... I copy/paste Sheet1 in MY COPY (routine and all including color fill) fill D48 in yellow , click the command button and decrypt the credit card number knowing the password used by the customer.
Many thanks
'this sub is only present to demonstrate use of the function!
'it is not required to use the function.
Dim r As Range, retVal, sKey As String
sKey = Application.InputBox("Enter your key", "Key entry", "My Key", , , , , 2)
retVal = MsgBox("This is the key you entered:" & vbNewLine & Chr$(34) & sKey & Chr$(34) & vbNewLine & _
"Please confirm OK or Cancel to exit", vbOKCancel, "Confirm Key")
If retVal = vbCancel Then Exit Sub
For Each r In Sheets("Sheet1").UsedRange
If r.Interior.ColorIndex = 6 Then
r.Value = XorC(r.Value, sKey)
End If
Next r
End Sub
I need help in adapting above by Richard Schollar/mdmackillop like this:
After the customer has filled the details of his credit card number [D48] and by a change event of that one cell (no need for a Command Button) the routine runs and encrypts the number.
I would like to delete the part that runs the code on "yellowed" cells .... rather restrict it to cell D48
If possible I will then try to add further code to the routine to kill the routine itself in the VBA editor and save the file.
My goal: The customer emails me his order with his credit card encrypted... I copy/paste Sheet1 in MY COPY (routine and all including color fill) fill D48 in yellow , click the command button and decrypt the credit card number knowing the password used by the customer.
Many thanks