VBA code Help Required

TheBuGz

Spammer
Joined
Jan 25, 2004
Messages
367
Code:
RegNameInLen = Len(RegNameIn)
RegEmailInLen = Len(RegEmailIn)
RegCodeInLen = Len(RegCodeIn)

RegNameFirLet = Mid(RegNameIn, 1, 1)
AtPos = InStr(1, RegEmailIn, "@")
FirLetPos1 = InStr(1, RegCodeIn, RegNameFirLet)
FirLetPos2 = InStrRev(RegCodeIn, RegNameFirLet)

Code1 = Mid(RegCodeIn, 1, FirLetPos1 - 1)
DecodePriv = Code1 / (RegNameInLen + AtPos + RegEmailInLen)

If DecodePriv <> PrivCode Then GoTo Fail:

Code2 = Mid(RegCodeIn, FirLetPos1 + 1, FirLetPos2 - (FirLetPos1 + 1))
DecodeNum = Code2 / AtPos
RemNum = Code2 Mod AtPos
If RemNum <> 0 Then GoTo Fail:

Code3 = Mid(RegCodeIn, FirLetPos2 + 1)
DecodeType = Code3 / RegEmailInLen
RemType = Code3 Mod RegEmailInLen

If RemType <> 0 Then GoTo Fail:


I want to enter the above code in my workbook


kindly help me how to check the code

I want the user to email me his
Name= Tom Hanks
Email =tomhanks@msn.com

and I will send the code to to him

How to Kindly help.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi, do you mean you want to email a workbook? The code you have posted seems incomplete to me - you will have to post it all and be clearer on explaining what you want.
 
Upvote 0

Forum statistics

Threads
1,214,638
Messages
6,120,674
Members
448,977
Latest member
moonlight6

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