Ricardasr25
New Member
- Joined
- Dec 29, 2013
- Messages
- 21
Good evening everybody I'm new to VBA,
I cant figure it out how to write the code.
Basically i have 25 labels and 5 textboxes next to these labels in userform it looks like that: lbl1 lbl2 lbl3 lbl4 lbl5 Textbox1
lbl6 lbl7 lbl8 lbl9 lbl10 Textbox2
lbl11 lbl12 lbl13 lbl14 lbl15 Textbox3
lbl16 lbl17 lbl18 lbl19 lbl20 Textbox4
lbl21 lbl22 lbl23 lbl24 lbl25 Textbox5
What i would like to achieve is if textbox has a value copy whole row from userform to database sheet, for example if:
lbl1 lbl2 lbl3 lbl4 lbl5 Textbox1 = 21(21 will be typed in to textbox)
lbl6 lbl7 lbl8 lbl9 lbl10 Textbox2
lbl11 lbl12 lbl13 lbl14 lbl15 Textbox3 = 12(12 will be typed in to textbox)
lbl16 lbl17 lbl18 lbl19 lbl20 Textbox4
lbl21 lbl22 lbl23 lbl24 lbl25 Textbox5 = 14(14 will be typed in to textbox)
So as you can see from this example when i press a button i would like to only copy caption of these three rows to database sheet : (because only three textboxes were filled other two rows should be skipped)
lbl1 lbl2 lbl3 lbl4 lbl5 Textbox1
lbl11 lbl12 lbl13 lbl14 lbl15 Textbox3
lbl21 lbl22 lbl23 lbl24 lbl25 Textbox5
If somebody can help on this code i would be very thankfull.
I cant figure it out how to write the code.
Basically i have 25 labels and 5 textboxes next to these labels in userform it looks like that: lbl1 lbl2 lbl3 lbl4 lbl5 Textbox1
lbl6 lbl7 lbl8 lbl9 lbl10 Textbox2
lbl11 lbl12 lbl13 lbl14 lbl15 Textbox3
lbl16 lbl17 lbl18 lbl19 lbl20 Textbox4
lbl21 lbl22 lbl23 lbl24 lbl25 Textbox5
What i would like to achieve is if textbox has a value copy whole row from userform to database sheet, for example if:
lbl1 lbl2 lbl3 lbl4 lbl5 Textbox1 = 21(21 will be typed in to textbox)
lbl6 lbl7 lbl8 lbl9 lbl10 Textbox2
lbl11 lbl12 lbl13 lbl14 lbl15 Textbox3 = 12(12 will be typed in to textbox)
lbl16 lbl17 lbl18 lbl19 lbl20 Textbox4
lbl21 lbl22 lbl23 lbl24 lbl25 Textbox5 = 14(14 will be typed in to textbox)
So as you can see from this example when i press a button i would like to only copy caption of these three rows to database sheet : (because only three textboxes were filled other two rows should be skipped)
lbl1 lbl2 lbl3 lbl4 lbl5 Textbox1
lbl11 lbl12 lbl13 lbl14 lbl15 Textbox3
lbl21 lbl22 lbl23 lbl24 lbl25 Textbox5
If somebody can help on this code i would be very thankfull.