Florence1550
New Member
- Joined
- May 2, 2021
- Messages
- 10
- Office Version
- 365
- Platform
- Windows
I have a user Form and I want to cycle through the controls and only put the values to the sheet that are not empty but can I use for example below
for I = 1 to 8
If Not Me.Combox(i).value = vbNullString Then
next i
ws.Cells(lastrow, 1).value = Date
ws.Cells(lastrow, 2).value = me.txtname.Value
ws.Cells(lastrow, 4).value = me.txtWBS.Value
ws.Cells(lastrow, 5).value = me.txtRef.Value
ws.Cells(lastrow, 6).value = Out
ws.Cells(lastrow, 7).value = me.combox(i).value
ws.Cells(lastrow, 8).value = me.txtQty(i).Value
ws.Cells(lastrow, 9).value = me.txtRef.Value
End If
Many thanks for the time.
for I = 1 to 8
If Not Me.Combox(i).value = vbNullString Then
next i
ws.Cells(lastrow, 1).value = Date
ws.Cells(lastrow, 2).value = me.txtname.Value
ws.Cells(lastrow, 4).value = me.txtWBS.Value
ws.Cells(lastrow, 5).value = me.txtRef.Value
ws.Cells(lastrow, 6).value = Out
ws.Cells(lastrow, 7).value = me.combox(i).value
ws.Cells(lastrow, 8).value = me.txtQty(i).Value
ws.Cells(lastrow, 9).value = me.txtRef.Value
End If
Many thanks for the time.