Hello
I am using a user form to list entries in an excel sheet. the user form has 3 rows and in each one there are 4 text boxes.
I need a code that will list all rows only if the first text box in each row has a value.
this code actually didn't work for me. it only lists the last row. I need your help on this please.
thank you
I am using a user form to list entries in an excel sheet. the user form has 3 rows and in each one there are 4 text boxes.
I need a code that will list all rows only if the first text box in each row has a value.
Code:
if me.acc1.value <>"" then
ws.Cells(iRow, 1).Value = Me.acc1.Value
ws.Cells(iRow, 2).Value = Me.txtRef.Value
ws.Cells(iRow, 4).Value = Me.desc1.Value
end if
if me.acc1.value <>"" then
ws.Cells(iRow, 1).Value = Me.acc2.Value
ws.Cells(iRow, 2).Value = Me.txtRef.Value
ws.Cells(iRow, 4).Value = Me.desc2.Value
end if
if me.acc1.value <>"" then
ws.Cells(iRow, 1).Value = Me.acc3.Value
ws.Cells(iRow, 2).Value = Me.txtRef.Value
ws.Cells(iRow, 4).Value = Me.desc3.Value
end if
this code actually didn't work for me. it only lists the last row. I need your help on this please.
thank you