Greetings,
I'm making my way up slowly but surely to get better at VBA coding but the road is still long thus I humbly request for any assistance from your side ray:
I actually have a worksheet as per below:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]Date[/TD]
[TD="align: center"]Item X[/TD]
[TD="align: center"]Item Y[/TD]
[TD="align: center"]Item Z[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
The sheet is populated with data from a UserForm with the following objects on it:
I actually can't get the VBA code right which will populate the worksheet as per below once I fill in the UserForm and hit the 'Save' button
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]USERFORM[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Start Date: 01/01/2019 End Date: 01/03/2019
Item X: ABCD
Item Y: EFGH
Item Z: IJKL
SAVE
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]Date[/TD]
[TD="align: center"]Item X[/TD]
[TD="align: center"]Item Y[/TD]
[TD="align: center"]Item Z[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]01/01/2019[/TD]
[TD="align: center"]ABCD[/TD]
[TD="align: center"]EFGH[/TD]
[TD="align: center"]IJKL[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]01/02/2019[/TD]
[TD="align: center"]ABCD[/TD]
[TD="align: center"]EFGH[/TD]
[TD="align: center"]IJKL[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]01/03/2019[/TD]
[TD="align: center"]ABCD[/TD]
[TD="align: center"]EFGH[/TD]
[TD="align: center"]IJKL[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Additionally if any date within the range is a Sunday, same must not be listed in the worksheet.
Finally in case the 'Start Date' and the 'End Date' are the same date, then only one row is to be filled.
That is:
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]USERFORM[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Start Date: 01/11/2019 End Date: 01/11/2019
Item X: MNOP
Item Y: QRST
ItemZ: UVWA
SAVE[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: center"]Date[/TD]
[TD="align: center"]Item X[/TD]
[TD="align: center"]Item Y[/TD]
[TD="align: center"]Item Z[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]01/01/2019[/TD]
[TD]ABCD[/TD]
[TD]EFGH[/TD]
[TD]IJKL[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]01/02/2019[/TD]
[TD]ABCD[/TD]
[TD]EFGH[/TD]
[TD]IJKL[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]01/03/2019[/TD]
[TD]ABCD[/TD]
[TD]EFGH[/TD]
[TD]IJKL[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]01/11/2019[/TD]
[TD]MNOP[/TD]
[TD]QRST[/TD]
[TD]UVWA[/TD]
[/TR]
</tbody>[/TABLE]
Thank you beforehand for your valuable help.
Cheers
Shameem
I'm making my way up slowly but surely to get better at VBA coding but the road is still long thus I humbly request for any assistance from your side ray:
I actually have a worksheet as per below:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]Date[/TD]
[TD="align: center"]Item X[/TD]
[TD="align: center"]Item Y[/TD]
[TD="align: center"]Item Z[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
The sheet is populated with data from a UserForm with the following objects on it:
- Start Date: (Label1) - Text box (TextBox1)
- End date: (Label2) - Text Box: (TextBox2)
- Item X: (Label3) - Text Box (TextBox3)
- Item Y: (Label4) - Text Box (TextBox4)
- Item Z: (Label5) - Text Box (TextBox5)
- Save - (CommandButton1)
I actually can't get the VBA code right which will populate the worksheet as per below once I fill in the UserForm and hit the 'Save' button
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]USERFORM[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Start Date: 01/01/2019 End Date: 01/03/2019
Item X: ABCD
Item Y: EFGH
Item Z: IJKL
SAVE
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]Date[/TD]
[TD="align: center"]Item X[/TD]
[TD="align: center"]Item Y[/TD]
[TD="align: center"]Item Z[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]01/01/2019[/TD]
[TD="align: center"]ABCD[/TD]
[TD="align: center"]EFGH[/TD]
[TD="align: center"]IJKL[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]01/02/2019[/TD]
[TD="align: center"]ABCD[/TD]
[TD="align: center"]EFGH[/TD]
[TD="align: center"]IJKL[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]01/03/2019[/TD]
[TD="align: center"]ABCD[/TD]
[TD="align: center"]EFGH[/TD]
[TD="align: center"]IJKL[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Additionally if any date within the range is a Sunday, same must not be listed in the worksheet.
Finally in case the 'Start Date' and the 'End Date' are the same date, then only one row is to be filled.
That is:
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]USERFORM[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Start Date: 01/11/2019 End Date: 01/11/2019
Item X: MNOP
Item Y: QRST
ItemZ: UVWA
SAVE[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: center"]Date[/TD]
[TD="align: center"]Item X[/TD]
[TD="align: center"]Item Y[/TD]
[TD="align: center"]Item Z[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]01/01/2019[/TD]
[TD]ABCD[/TD]
[TD]EFGH[/TD]
[TD]IJKL[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]01/02/2019[/TD]
[TD]ABCD[/TD]
[TD]EFGH[/TD]
[TD]IJKL[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]01/03/2019[/TD]
[TD]ABCD[/TD]
[TD]EFGH[/TD]
[TD]IJKL[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]01/11/2019[/TD]
[TD]MNOP[/TD]
[TD]QRST[/TD]
[TD]UVWA[/TD]
[/TR]
</tbody>[/TABLE]
Thank you beforehand for your valuable help.
Cheers
Shameem