PDA

View Full Version : [SOLVED] Paste to row problem



sharky12345
09-04-2015, 02:45 AM
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.


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

Posted elsewhere too:

http://www.mrexcel.com/forum/excel-questions/880553-paste-row-problem.html#post4266350

sharky12345
09-04-2015, 05:44 AM
Solved elsewhere