Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Request] - Convert Excel formula to VB6 Code
#8
(04-18-2010, 04:18 AM)Extasey Wrote: I have two suggestions:
1. Try and embed the excel sheet and continue normal functioning of the application
2. Split the if statements up for me an i'll lend you a hand.
Because of the format, I have no idea whats going on in 2 and especially 3. I may have an example at school that was a bar-code validation program I could send you if your able to learn from source code (some are, most aren't).

Thanks so much for your reply Big Grin ....

1. I cannot embed the excel sheet as you suggest, because the sheet's properties are set to be invisible and its only the form that loads upon opening the workbook

3. I can learn great from source codes, I think I might get lucky if I see how the barcode validation is done .. Looks like exactly what I want Smile

2.
Code:
11-MOD((LEFT(D11,1)*2)+(MID(D11,2,1)*1)+(MID(D11,3,1)*6)+(MID(D11,4,1)*3)+(MID(D11,​5,1)*7)+(MID(D11,6,1)*9)+(MID(D11,7,1)*10)+(MID(D11,8,1)*5)+(MID(D11,9,1)*8)+(MI​D(D11,10,1)*4)+(MID(D11,11,1)*2),11))=VALUE(RIGHT(D11,1)

The above would be the main code. The remaining codes are just validating the inputs, ex. should be 12 digits.

The second and third codes are just displaying the age and date of birth if the above code is "True". Date of Birth is pulled out from the number itself, with validation to check if less than year 2000 or above, being the first digit 2 or 3

Hope this helps. Smile

I'll wait to read your barcode code Big Grin
[Image: IKILLUNEW.jpg]
Reply


Messages In This Thread
RE: [Request] - Convert Excel formula to VB6 Code - by Carb0n F1ber - 04-18-2010, 04:36 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  vb6.0 SSTab control disappeared DanB 0 1,210 12-29-2012, 10:24 AM
Last Post: DanB
  Get Country Code In 1 Line Of Code. wchar_t 13 4,144 11-28-2012, 06:49 AM
Last Post: Cubs
  [HELP][VB6] Comparing md5/file size? Cloud203 5 2,171 02-04-2012, 02:47 PM
Last Post: Denny Crane
  VB6 | PickYourShow0.1 BETA BreShiE 29 6,262 01-11-2012, 02:44 AM
Last Post: BreShiE
  [VB6] Shopping List BreShiE 3 1,408 12-30-2011, 07:51 PM
Last Post: BreShiE

Forum Jump:


Users browsing this thread: 1 Guest(s)