{"id":14379,"date":"2017-10-12T20:46:34","date_gmt":"2017-10-12T20:46:34","guid":{"rendered":"http:\/\/learnexcelmacro.com\/wp\/?p=14379"},"modified":"2017-10-12T21:23:39","modified_gmt":"2017-10-12T21:23:39","slug":"random-bsn-generator-tool","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/","title":{"rendered":"Random BSN Generator – SoFiNummer Generator"},"content":{"rendered":"

Dear Friends,<\/p>\n

In one of my previous article, I explained you about Netherlands BSN Number<\/a> validation. This used to be called as SoFi nummer <\/a>(Short form of dutch word – So<\/strong>ciaalfi<\/strong>scaal nummer) as well in the Past. Here in this article, I am sharing VBA code and a FREE downloadable excel to generate random BSN numbers.
\nAt the end of this article, you will find a download link to download the tool – Random BSN Generator Tool – Excel.<\/p>\n

In the previous article, I had shared in detail about the followings:<\/p>\n

[fullwidth background_color=”#fff4f4″ background_image=”” background_parallax=”none” parallax_speed=”0.1″ enable_mobile=”no” background_repeat=”no-repeat” background_position=”left top” video_url=”” video_aspect_ratio=”16:9″ video_webm=”” video_mp4=”” video_ogv=”” video_preview_image=”” overlay_color=”” overlay_opacity=”0.5″ video_mute=”yes” video_loop=”yes” fade=”no” border_size=”1px” border_color=”#ff8e8e” border_style=”solid” padding_top=”20″ padding_bottom=”20″ padding_left=”20″ padding_right=”20″ hundred_percent=”no” equal_height_columns=”no” menu_anchor=”” class=”” id=””]<\/p>\n

<\/i> What is Elfproef or 11-Check \u2013 Specific to BSN<\/a><\/h3>\n

<\/i> What is BSN Number<\/a><\/h3>\n

<\/i> VBA Code to do 11-Check (Elfproef) for BSN<\/a><\/h3>\n

<\/i> A downloadable excel tool – BSN Validator – Function and UDF both<\/a><\/h3>\n

[\/fullwidth]<\/p>\n

I would recommend you to read that article first.<\/p>\n

Random BSN Number Generator in Excel using VBA<\/h1>\n

Now since you already know enough about BSN number, here I am going to share with you a VBA code which can help you in generating a random valid BSN Number. I have also create a downloadable excel tool to generate the Random BSN number which can be downloaded from the link mentioned at the end of this article. Here is a screen shot of the tool:<\/p>\n

\"Random<\/p>\n

What is the Use of this Code \/ Tool?<\/h1>\n

For testing any application which uses a BSN number as an input, every time you need a valida BSN number handy to use it. This simple VBA code can be used to achieve this.
\nYou can ofcourse get it generated from Internet. There are websites which generates a random BSN number every time you press a button.
\nThis excel tool, also does the same thing.<\/p>\n

Advantages<\/h2>\n

1.<\/strong> For this to work you do not need to be connected to Internet.
\n2.<\/strong> If you are capturing your Test data or test cases in Excel, you don’t have to generate it from some website and put it in your excel sheet.<\/p>\n

Logic used behind generating this Random BSN number<\/h1>\n

It consists of two functions.
\n1. Function to generate a Random 9 digit Number between 100000000(lowest 9 digit number) and 999999999 (highest 9 digit number).<\/p>\n

2. Function to validate whether a 9 digit number is a valid BSN number or not?<\/p>\n

After generating every random number, first function call the second function to validate if that random number is passing the elfCheck <\/a>or it is a valid BSN number.
\nIt keeps on generating random number, until it finds a random number which passes the BSN check.
\nAs soon as a random number passes a BSN check, it comes out of the loop and displays that Random number as a next random valid BSN number.
\nThis random number you can capture in a message box, text box, in a cell or how ever you want to use.<\/p>\n

Here is the VBA code for Generating Valid BSN Number<\/h1>\n

VBA Function to generate 9 digit Random Number<\/h2>\n
\r\nSub generateRandomBSNNumber()\r\n' Function to generate a random 9 digit number\r\n    Dim rndNumber As Double\r\n    Dim lowLimit As Double\r\n    Dim highLimit As Double\r\n    lowLimit = 100000000 ' lowest 9 digit number\r\n    highLimit = 999999999 ' highest 9 digit number\r\n    Do\r\n' generate a 9 digit Random number\r\n        rndNumber = Int((highLimit - lowLimit + 1) * Rnd() + lowLimit)\r\n' loop until random generated number is a valid BSN\r\n    Loop Until isValidBSN(CStr(rndNumber)) = True\r\n' store the random number which\r\n' passes the elfCheck\r\n    Range(\"bsn\").Value = rndNumber\r\nEnd Sub\r\n<\/code><\/pre>\n

VBA Function to check if given number is a Valid BSN Number<\/h2>\n

This is the same function which I have explained in detail in this article which I mentioned above.<\/p>\n

\r\nFunction isValidBSN(bsn As String) As Boolean\r\n        Dim totalSum\r\n        totalSum = 0\r\n' Follow standard 11-check algorithm till the\r\n' second last digit of the 9 digit number\r\n        For i = 9 To 2 Step -1\r\n            totalSum = totalSum + CInt(VBA.Mid(bsn, 10 - i, 1)) * i\r\n        Next\r\n' Weighted multiplication factor for\r\n' the last digit is (-1)\r\n        totalSum = totalSum + (CInt(VBA.Mid(bsn, 10 - i, 1))) * (-1)\r\n'11-Check true if divisible by 11\r\n        If (totalSum Mod 11) = 0 Then isValidBSN = True Else isValidBSN = False\r\nEnd Function\r\n<\/code><\/pre>\n

<\/i> Download – Random BSN Number Generator – Excel Tool<\/h1>\n

Here is your Excel tool to download. Do not forget to provide your feedback \ud83d\ude42
\n

\"Random<\/a>

Random BSN Number Generator<\/p><\/div><\/p>\n<\/span>","protected":false},"excerpt":{"rendered":"

Dear Friends, In one of my previous article, I explained you about Netherlands BSN Number validation. This used to be called as SoFi nummer (Short form of dutch word – Sociaalfiscaal nummer) as well in the Past. Here in this article, I am sharing VBA code and a FREE downloadable excel to generate random BSN […]<\/p>\n","protected":false},"author":45,"featured_media":14405,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[2077,2056],"tags":[],"yoast_head":"\nRandom BSN Generator - SoFiNummer Generator - Let's excel in Excel<\/title>\n<meta name=\"description\" content=\"Random BSN Generator, Random Sofi nummer generator, Download Random BSN generator Tool. Excel Macro to generate random BSN number. VBA to generate BSN number\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Random BSN Generator - SoFiNummer Generator\" \/>\n<meta property=\"og:description\" content=\"Random BSN Generator, Random Sofi nummer generator, Download Random BSN generator Tool. Excel Macro to generate random BSN number. VBA to generate BSN number\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/\" \/>\n<meta property=\"og:site_name\" content=\"Let's excel in Excel\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/vmlogger\" \/>\n<meta property=\"article:author\" content=\"http:\/\/www.facebook.com\/vmlogger\" \/>\n<meta property=\"article:published_time\" content=\"2017-10-12T20:46:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-10-12T21:23:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2017\/10\/random-bsn-generator.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"538\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Vishwamitra Mishra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/www.twitter.com\/learnexcelmacro\" \/>\n<meta name=\"twitter:site\" content=\"@learnexcelmacro\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vishwamitra Mishra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/\"},\"author\":{\"name\":\"Vishwamitra Mishra\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"headline\":\"Random BSN Generator – SoFiNummer Generator\",\"datePublished\":\"2017-10-12T20:46:34+00:00\",\"dateModified\":\"2017-10-12T21:23:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/\"},\"wordCount\":687,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"articleSection\":[\"Excel Tools\",\"User Defined Function\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/\",\"name\":\"Random BSN Generator - SoFiNummer Generator - Let's excel in Excel\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\"},\"datePublished\":\"2017-10-12T20:46:34+00:00\",\"dateModified\":\"2017-10-12T21:23:39+00:00\",\"description\":\"Random BSN Generator, Random Sofi nummer generator, Download Random BSN generator Tool. Excel Macro to generate random BSN number. VBA to generate BSN number\",\"breadcrumb\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/vmlogger.com\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Excel Tools\",\"item\":\"https:\/\/vmlogger.com\/excel\/excel-tools\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Random BSN Generator – SoFiNummer Generator\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\",\"url\":\"https:\/\/vmlogger.com\/excel\/\",\"name\":\"Let's excel in Excel\",\"description\":\"Let's share knowledge\",\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/vmlogger.com\/excel\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\",\"name\":\"Vishwamitra Mishra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png\",\"contentUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png\",\"width\":528,\"height\":560,\"caption\":\"Vishwamitra Mishra\"},\"logo\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/\"},\"description\":\"My name is Vishwamitra Mishra. Friends Call me Vishwa. I hold a Bachelor\u2019s Degree in Computer Science from D.A.V.V. Indore & currently working as a Technical Lead having over 7 years of experience.\",\"sameAs\":[\"http:\/\/www.learnexcelmacro.com\",\"http:\/\/www.facebook.com\/vmlogger\",\"https:\/\/twitter.com\/https:\/\/www.twitter.com\/learnexcelmacro\",\"https:\/\/www.youtube.com\/c\/VMLogger\"],\"url\":\"https:\/\/vmlogger.com\/excel\/author\/vishwamitra\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Random BSN Generator - SoFiNummer Generator - Let's excel in Excel","description":"Random BSN Generator, Random Sofi nummer generator, Download Random BSN generator Tool. Excel Macro to generate random BSN number. VBA to generate BSN number","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/","og_locale":"en_US","og_type":"article","og_title":"Random BSN Generator - SoFiNummer Generator","og_description":"Random BSN Generator, Random Sofi nummer generator, Download Random BSN generator Tool. Excel Macro to generate random BSN number. VBA to generate BSN number","og_url":"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/","og_site_name":"Let's excel in Excel","article_publisher":"http:\/\/www.facebook.com\/vmlogger","article_author":"http:\/\/www.facebook.com\/vmlogger","article_published_time":"2017-10-12T20:46:34+00:00","article_modified_time":"2017-10-12T21:23:39+00:00","og_image":[{"width":800,"height":538,"url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2017\/10\/random-bsn-generator.jpg","type":"image\/jpeg"}],"author":"Vishwamitra Mishra","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/www.twitter.com\/learnexcelmacro","twitter_site":"@learnexcelmacro","twitter_misc":{"Written by":"Vishwamitra Mishra","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/#article","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/"},"author":{"name":"Vishwamitra Mishra","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"headline":"Random BSN Generator – SoFiNummer Generator","datePublished":"2017-10-12T20:46:34+00:00","dateModified":"2017-10-12T21:23:39+00:00","mainEntityOfPage":{"@id":"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/"},"wordCount":687,"commentCount":1,"publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"articleSection":["Excel Tools","User Defined Function"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/","url":"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/","name":"Random BSN Generator - SoFiNummer Generator - Let's excel in Excel","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/#website"},"datePublished":"2017-10-12T20:46:34+00:00","dateModified":"2017-10-12T21:23:39+00:00","description":"Random BSN Generator, Random Sofi nummer generator, Download Random BSN generator Tool. Excel Macro to generate random BSN number. VBA to generate BSN number","breadcrumb":{"@id":"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/vmlogger.com\/excel\/2017\/10\/random-bsn-generator-tool\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vmlogger.com\/excel\/"},{"@type":"ListItem","position":2,"name":"Excel Tools","item":"https:\/\/vmlogger.com\/excel\/excel-tools\/"},{"@type":"ListItem","position":3,"name":"Random BSN Generator – SoFiNummer Generator"}]},{"@type":"WebSite","@id":"https:\/\/vmlogger.com\/excel\/#website","url":"https:\/\/vmlogger.com\/excel\/","name":"Let's excel in Excel","description":"Let's share knowledge","publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vmlogger.com\/excel\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5","name":"Vishwamitra Mishra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/","url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png","contentUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png","width":528,"height":560,"caption":"Vishwamitra Mishra"},"logo":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/"},"description":"My name is Vishwamitra Mishra. Friends Call me Vishwa. I hold a Bachelor\u2019s Degree in Computer Science from D.A.V.V. Indore & currently working as a Technical Lead having over 7 years of experience.","sameAs":["http:\/\/www.learnexcelmacro.com","http:\/\/www.facebook.com\/vmlogger","https:\/\/twitter.com\/https:\/\/www.twitter.com\/learnexcelmacro","https:\/\/www.youtube.com\/c\/VMLogger"],"url":"https:\/\/vmlogger.com\/excel\/author\/vishwamitra\/"}]}},"_links":{"self":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/14379"}],"collection":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/comments?post=14379"}],"version-history":[{"count":0,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/14379\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/media\/14405"}],"wp:attachment":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/media?parent=14379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/categories?post=14379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/tags?post=14379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}