dimming a cell

sassriverrat

Well-known Member
Joined
Oct 4, 2018
Messages
655
good morning,

I have some code that I've written/compiled for making a "registration key" of sorts for a workbook. Only issue, if the "password, as defined in cell B39, is a series of numbers, the coding works perfectly. if the password is a word or letters, it doesn't. I'm guessing I've got everything dimmed wrong.

Someone help please. thanks!

Code:
Dim s As StringDim namer As String
Dim d As String
Dim ExpirationDate As Date
Dim pass1 As String
Dim pass2 As String




With Sheets("Developer")
    s = .Range("B34")                   'username
    'pass1 = .Range("B15:E15").Value     'sheet unprotect
    'pass2 = .Range("B39").Value         'date password
    ExpirationDate = .Range("E37")      'expiration date
    d = .Range("B39").Value             'registration key
    initialdate = .Range("C36")         'initializing date
End With


TryAgain:
        d = Application.InputBox("Your workbook date has expired. Please enter the registration key to renew your license.", namer)
        If d = False Then Exit Sub
        If d = CStr(Worksheets("Developer").Range("B39").Value) Then
            Sheets("Developer").Range("C36") = Date
            MsgBox "Welcome Back " & s, vbOKOnly, namer
        Else
            MsgBox "Password Incorrect, Please try again.", vbCritical, namer
            GoTo TryAgain
        End If
    End If
 
@Yongle

Great quick piece...I appreciate you posting that because I learned something new (something new everyday!). So I do see the advantages of the inputbox and I'll go with that.

Thank you all as always! I think I'm finally starting to be knowledgeable enough to pay it back- so thanks to you guys!
 
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,223,268
Messages
6,171,100
Members
452,379
Latest member
IainTru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top