Adjusting code transfer data from combo box & textbox into userform to sheet
Closed
abdelfatah_0230
Posts
73
Registration date
Thursday July 18, 2019
Status
Member
Last seen
July 23, 2022
-
Updated on Nov 3, 2019 at 05:04 AM
Facebook - Nov 21, 2019 at 04:03 PM
Facebook - Nov 21, 2019 at 04:03 PM
Related:
- Adjusting code transfer data from combo box & textbox into userform to sheet
- Free fire transfer - Guide
- Transfer data from one excel worksheet to another automatically - Guide
- Battery reset code - Guide
- How to get whatsapp verification code online - Guide
- Samsung volume increase code - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Nov 5, 2019 at 11:41 AM
Nov 5, 2019 at 11:41 AM
Hi Abdel,
You are getting an error because you have TextBox# and ComboBox#, but not a TextBoxComboBox#.
You could change:
.Cells(Lastrow, i).Value = Me.Controls("TextBox" & "combobox" & i)
Me.Controls("TextBox" & "combobox" & i) = ""
into:
.Cells(Lastrow, i).Value = Me.Controls("TextBox" & i) & " " & Me.Controls("ComboBox" & i)
Me.Controls("TextBox" & i) = vbnullstring
Me.Controls("ComboBox" & i) = vbnullstring
Best regards,
Trowa
You are getting an error because you have TextBox# and ComboBox#, but not a TextBoxComboBox#.
You could change:
.Cells(Lastrow, i).Value = Me.Controls("TextBox" & "combobox" & i)
Me.Controls("TextBox" & "combobox" & i) = ""
into:
.Cells(Lastrow, i).Value = Me.Controls("TextBox" & i) & " " & Me.Controls("ComboBox" & i)
Me.Controls("TextBox" & i) = vbnullstring
Me.Controls("ComboBox" & i) = vbnullstring
Best regards,
Trowa
Nov 5, 2019 at 02:43 PM
i attach my file
https://ufile.io/u2xzo9cy
Nov 11, 2019 at 11:52 AM
When the code errors out, place your cursor over the yellow line above the "i". It should tell you that the current value for i = 7. That means that 1 to 6 went ok. So I checked TextBox7 and ComboBox7. Which showed the reason for the error: you don't have a ComboBox7.
Best regards,
Trowa
Nov 11, 2019 at 01:24 PM
Nov 12, 2019 at 11:49 AM
Row 40 is the first empty row of column A from the bottom up, which is what this part of the code does:
Cells(Rows.Count, 1).End(3).Row + 1
And since that cell is merged, only the value in column A is shown.
Best regards,
Trowa
Nov 12, 2019 at 01:47 PM
by the way the cells rows from 23:24 not emerged cells