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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

parry

MrExcel MVP
Joined
Aug 20, 2002
Messages
3,355
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.
 

TheBuGz

Spammer
Joined
Jan 25, 2004
Messages
367
Thank you Parry you were late to reply i have done it by myself.

Thanx a Lot
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,321
Messages
5,769,444
Members
425,546
Latest member
DisMissive

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
Top