I am trying to fill in missing data in a spreadsheet. What I am trying to create is a macro that would populate a userform with listboxes for each blank cell in the row. See example below:
<tbody>
</tbody>
With the above example, the macro would see that "age" and "homeower" colums are blank in row 1, so a userform would appear to with only those two fields to be entered. For row two, a userform would appear with listboxes for "Zipcode", "Fav Food", and homeowner.
Is this possible? this is what I have tried so far:
Dim x As Object
Set x = UserForm1
x.Controls.Add bstrprogid:="Forms.Textbox.1", Name:="Textbox2", Visible:=True
UserForm1.Show
Dim Table As Range
Dim lastrowa As Variant
lastrowa = Range("A1", Range("A1").End(xlDown)).Rows.Count
Set Table = Range("A2" & ":" & "AP" & lastrowa)
If this is possible, what I would like it to do is scan through each row in the spreadsheet, and show the userform for each blank cell in the row. But I am really struggling with this. Any advice would be appreciated!
Name | Zip Code | Age | Fav Food | Homeowner |
Daniel | 33706 | Pizza | ||
Martha | 27 | Yes |
<tbody>
</tbody>
With the above example, the macro would see that "age" and "homeower" colums are blank in row 1, so a userform would appear to with only those two fields to be entered. For row two, a userform would appear with listboxes for "Zipcode", "Fav Food", and homeowner.
Is this possible? this is what I have tried so far:
Dim x As Object
Set x = UserForm1
x.Controls.Add bstrprogid:="Forms.Textbox.1", Name:="Textbox2", Visible:=True
UserForm1.Show
Dim Table As Range
Dim lastrowa As Variant
lastrowa = Range("A1", Range("A1").End(xlDown)).Rows.Count
Set Table = Range("A2" & ":" & "AP" & lastrowa)
If this is possible, what I would like it to do is scan through each row in the spreadsheet, and show the userform for each blank cell in the row. But I am really struggling with this. Any advice would be appreciated!
Last edited: