sharky12345
Well-known Member
- Joined
- Aug 5, 2010
- Messages
- 3,404
- Office Version
- 2016
- Platform
- Windows
Can't seem to work this out - I'm trying to copy userform values to a sheet but with the following criteria;
1) Each cell from C4 down is NOT empty
2) For each of those cells, the adjacent cell in column D IS empty
I've played around with this but it just keeps overwriting my existing data in column C.
1) Each cell from C4 down is NOT empty
2) For each of those cells, the adjacent cell in column D IS empty
I've played around with this but it just keeps overwriting my existing data in column C.
Code:
Dim lr As Long, c As Range
lr = Sheets("Packs").Cells(Rows.Count, 3).End(xlUp).Row
For Each c In Sheets("Packs").Range("C4:C" & lr)
If c.Value <> 0 Then
c.Offset(, 1) = ComboBox4.Value
c.Offset(, 2) = ComboBox3.Value
c.Offset(, 3) = TXTCOMMENTS.Value
c.Offset(, 4) = TextBox3.Value
c.Offset(, 5) = TextBox10.Value
End If
Next c