kdashsohel
New Member
- Joined
- Jul 27, 2017
- Messages
- 9
Hello everyone,
I am fairly novice in terms of Macro and VBA. I work for immigration, and my supervisor had given me quite a huge task. I have a spreadsheet where I have to put information of a person's background and its family size. My problem is I am unable to figure out how to automatically create the number of rows once the family size has been inputted, also how to assign a number for each group of family created. For example below,
*(red means input, pink means automatic computerized input)*
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]#[/TD]
[TD]# of Family[/TD]
[TD]First Name[/TD]
[TD]Last Name[/TD]
[TD]ID[/TD]
[TD]Family Size[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD]Dennis[/TD]
[TD]Smith[/TD]
[TD]123[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD]Keith[/TD]
[TD]John[/TD]
[TD]456[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD]Damian[/TD]
[TD]Doe[/TD]
[TD]789[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Then
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]#[/TD]
[TD]# of Family[/TD]
[TD]First Name[/TD]
[TD]Last Name[/TD]
[TD]ID[/TD]
[TD]Family Size[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]Dennis[/TD]
[TD]Smith[/TD]
[TD]123[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD]Keith[/TD]
[TD]John[/TD]
[TD]456[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD]Damian[/TD]
[TD]Doe[/TD]
[TD]789[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Then
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]#[/TD]
[TD]# of Family[/TD]
[TD]First Name[/TD]
[TD]Last Name[/TD]
[TD]ID[/TD]
[TD]Family Size[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]Dennis[/TD]
[TD]Smith[/TD]
[TD]123[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]Jane[/TD]
[TD]Smith[/TD]
[TD]741[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]Mark[/TD]
[TD]Smith[/TD]
[TD]852[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1[/TD]
[TD]Julie[/TD]
[TD]Smith[/TD]
[TD]963[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD]Keith[/TD]
[TD]John[/TD]
[TD]456[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD]Damian[/TD]
[TD]Doe[/TD]
[TD]789[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]#[/TD]
[TD]# of Family[/TD]
[TD]First Name[/TD]
[TD]Last Name[/TD]
[TD]ID[/TD]
[TD]Family Size[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]Dennis[/TD]
[TD]Smith[/TD]
[TD]123[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD]Keith[/TD]
[TD]Joe[/TD]
[TD]456[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD]Damian[/TD]
[TD]Doe[/TD]
[TD]789[/TD]
[/TR]
</tbody>[/TABLE]
</body>
Then
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]#[/TD]
[TD]# of Family[/TD]
[TD]First Name[/TD]
[TD]Last Name[/TD]
[TD]ID[/TD]
[TD]Family Size[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]Dennis[/TD]
[TD]Smith[/TD]
[TD]123[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]Jane[/TD]
[TD]Smith[/TD]
[TD]741[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]Mark[/TD]
[TD]Smith[/TD]
[TD]852[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1[/TD]
[TD]Julie[/TD]
[TD]Smith[/TD]
[TD]963[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD]Keith[/TD]
[TD]John[/TD]
[TD]456[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD]Damian[/TD]
[TD]Doe[/TD]
[TD]789[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Then
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]#[/TD]
[TD]# of Family[/TD]
[TD]First Name[/TD]
[TD]Last Name[/TD]
[TD]ID[/TD]
[TD]Family Size[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]Dennis[/TD]
[TD]Smith[/TD]
[TD]123[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]Jane[/TD]
[TD]Smith[/TD]
[TD]741[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]Mark[/TD]
[TD]Smith[/TD]
[TD]852[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1[/TD]
[TD]Julie[/TD]
[TD]Smith[/TD]
[TD]963[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD]Keith[/TD]
[TD]John[/TD]
[TD]456[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD]Damian[/TD]
[TD]Doe[/TD]
[TD]789[/TD]
[TD]2[/TD]
[/TR]
</tbody>[/TABLE]
Then
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]#[/TD]
[TD]# of Family[/TD]
[TD]First Name[/TD]
[TD]Last Name[/TD]
[TD]ID[/TD]
[TD]Family Size[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]Dennis[/TD]
[TD]Smith[/TD]
[TD]123[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]Jane[/TD]
[TD]Smith[/TD]
[TD]741[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]Mark[/TD]
[TD]Smith[/TD]
[TD]852[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1[/TD]
[TD]Julie[/TD]
[TD]Smith[/TD]
[TD]963[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD]Keith[/TD]
[TD]John[/TD]
[TD]456[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]2[/TD]
[TD]Damian[/TD]
[TD]Doe[/TD]
[TD]789[/TD]
[TD]2
[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]2[/TD]
[TD]Maryam[/TD]
[TD]Doe[/TD]
[TD]951[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I am probably asking too much since I am new in this forum. Any help is greatly appreaciated.
*Note that my work environment involves two languages, English and French. I am working on an english computer station, but the majority of my colleagues are working in a french computer station. I am not sure if the VBA language will impact how excel works once shared in a different station.*
Once again thanks to anyone who is willing to take their time in helping me out!
I am fairly novice in terms of Macro and VBA. I work for immigration, and my supervisor had given me quite a huge task. I have a spreadsheet where I have to put information of a person's background and its family size. My problem is I am unable to figure out how to automatically create the number of rows once the family size has been inputted, also how to assign a number for each group of family created. For example below,
*(red means input, pink means automatic computerized input)*
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]#[/TD]
[TD]# of Family[/TD]
[TD]First Name[/TD]
[TD]Last Name[/TD]
[TD]ID[/TD]
[TD]Family Size[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD]Dennis[/TD]
[TD]Smith[/TD]
[TD]123[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD]Keith[/TD]
[TD]John[/TD]
[TD]456[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD]Damian[/TD]
[TD]Doe[/TD]
[TD]789[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Then
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]#[/TD]
[TD]# of Family[/TD]
[TD]First Name[/TD]
[TD]Last Name[/TD]
[TD]ID[/TD]
[TD]Family Size[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]Dennis[/TD]
[TD]Smith[/TD]
[TD]123[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD]Keith[/TD]
[TD]John[/TD]
[TD]456[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD]Damian[/TD]
[TD]Doe[/TD]
[TD]789[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Then
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]#[/TD]
[TD]# of Family[/TD]
[TD]First Name[/TD]
[TD]Last Name[/TD]
[TD]ID[/TD]
[TD]Family Size[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]Dennis[/TD]
[TD]Smith[/TD]
[TD]123[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]Jane[/TD]
[TD]Smith[/TD]
[TD]741[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]Mark[/TD]
[TD]Smith[/TD]
[TD]852[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1[/TD]
[TD]Julie[/TD]
[TD]Smith[/TD]
[TD]963[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD]Keith[/TD]
[TD]John[/TD]
[TD]456[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD]Damian[/TD]
[TD]Doe[/TD]
[TD]789[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]#[/TD]
[TD]# of Family[/TD]
[TD]First Name[/TD]
[TD]Last Name[/TD]
[TD]ID[/TD]
[TD]Family Size[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]Dennis[/TD]
[TD]Smith[/TD]
[TD]123[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD]Keith[/TD]
[TD]Joe[/TD]
[TD]456[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD]Damian[/TD]
[TD]Doe[/TD]
[TD]789[/TD]
[/TR]
</tbody>[/TABLE]
</body>
Then
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]#[/TD]
[TD]# of Family[/TD]
[TD]First Name[/TD]
[TD]Last Name[/TD]
[TD]ID[/TD]
[TD]Family Size[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]Dennis[/TD]
[TD]Smith[/TD]
[TD]123[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]Jane[/TD]
[TD]Smith[/TD]
[TD]741[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]Mark[/TD]
[TD]Smith[/TD]
[TD]852[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1[/TD]
[TD]Julie[/TD]
[TD]Smith[/TD]
[TD]963[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD]Keith[/TD]
[TD]John[/TD]
[TD]456[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD]Damian[/TD]
[TD]Doe[/TD]
[TD]789[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Then
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]#[/TD]
[TD]# of Family[/TD]
[TD]First Name[/TD]
[TD]Last Name[/TD]
[TD]ID[/TD]
[TD]Family Size[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]Dennis[/TD]
[TD]Smith[/TD]
[TD]123[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]Jane[/TD]
[TD]Smith[/TD]
[TD]741[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]Mark[/TD]
[TD]Smith[/TD]
[TD]852[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1[/TD]
[TD]Julie[/TD]
[TD]Smith[/TD]
[TD]963[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD]Keith[/TD]
[TD]John[/TD]
[TD]456[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD]Damian[/TD]
[TD]Doe[/TD]
[TD]789[/TD]
[TD]2[/TD]
[/TR]
</tbody>[/TABLE]
Then
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]#[/TD]
[TD]# of Family[/TD]
[TD]First Name[/TD]
[TD]Last Name[/TD]
[TD]ID[/TD]
[TD]Family Size[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]Dennis[/TD]
[TD]Smith[/TD]
[TD]123[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]Jane[/TD]
[TD]Smith[/TD]
[TD]741[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]Mark[/TD]
[TD]Smith[/TD]
[TD]852[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1[/TD]
[TD]Julie[/TD]
[TD]Smith[/TD]
[TD]963[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD]Keith[/TD]
[TD]John[/TD]
[TD]456[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]2[/TD]
[TD]Damian[/TD]
[TD]Doe[/TD]
[TD]789[/TD]
[TD]2
[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]2[/TD]
[TD]Maryam[/TD]
[TD]Doe[/TD]
[TD]951[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I am probably asking too much since I am new in this forum. Any help is greatly appreaciated.
*Note that my work environment involves two languages, English and French. I am working on an english computer station, but the majority of my colleagues are working in a french computer station. I am not sure if the VBA language will impact how excel works once shared in a different station.*
Once again thanks to anyone who is willing to take their time in helping me out!