copies blank cell. screws up layout of rows

hopr37

Board Regular
Joined
Apr 16, 2018
Messages
76
2 worksheets
worksheet 1 is for entering data
worksheet 2 makes a copy of certain rows of data from worksheet 1 ( depending if a value was added to a certain row from worksheet 1)

worksheet 1:

Value 1Value 1Value 1
BlankValue 2Value 2
Value 3Value 3Value 3

<tbody>
</tbody>

So....
Whenever I change a value in the center column, it copies the values of that entire row.
Change value 1 in center column copies first, center and last row to different worksheet. That works great.
Change value 3 in center column copies first,center and last row to a different worksheet just underneath the previous column...that works great.
Now... If I were to change the value in the center column of value 2 AND the first column is blank, it still copies over to a different worksheet. However,
since there is no data in the first row it leaves it blank. The problem is, if I were to change another value in a different center column it moves the entire first row up while leaving the other rows in place thus causing everything to be off . ( Essentially, it would move value 3 up to the blank spot)

Any idea how I can avoid this?
 
Last edited:
If you ran the code I supplied in post#15 & then ran the mod I suggested in post#4 the data would have been copied to row 5.
If it isn't, then you have something else happening.
 
Upvote 0

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
I redid it and yes, It does put everything where it should start out. However, the issue hasn't changed.
If row c has a blank and you make another change, it pushes the second and third row up one row.

this is my original rows and columns

descriptionnumber 1number 2
BLANKnumber 3number 4

<tbody>
</tbody>


So if I change the center column ( number 1), it copies row 1,2 and 3 to the "RunningTotal" worksheet. ( description, number 1, number 2)

THEN let's say I change the second row in the center column from number 3 to number 66. It copies the second row to the next row on the "RunningTotal" worksheet. ( BLANK, number 66, number 4
descriptionnumber 1number 2
BLANKnumber 66number 4

<tbody>
</tbody>

NOW. let's say I change the first row again. This time from number 1 to say number 22. This is what happens
descriptionnumber 1number 2
descriptionnumber 66number 4
BLANKnumber 22number 2

<tbody>
</tbody>

see how number 66 and number 4 jump up instead of keeping it : BLANK, number 66, number 4.

This is how it should look
descriptionnumber 1number 2
BLANKnumber 66number 4
descriptionnumber 22number 2

<tbody>
</tbody>
 
Last edited:
Upvote 0
The code I supplied, does not do that. In fact it would overwrite your data all the time because I made a small mistake. Try this
Code:
Dim Nxtrw As Long
   Application.ScreenUpdating = False

   If Not Intersect(Target, Range("D:D")) Is Nothing Then
      Nxtrw = Sheets("RunningTotal").Range("C:E").Find("*", , xlValues, , xlRows, xlPrevious, , , False)[COLOR=#ff0000].Offset(1)[/COLOR].Row
      
      Sheets("RunningTotal").Range("C" & Nxtrw).Value = Sheets("Copper").Range("A" & Target.Row).Value 'copies column A from "Copper" to C4 of "Running Total"
      Sheets("RunningTotal").Range("D" & Nxtrw).Value = Sheets("Copper").Range("D" & Target.Row).Value 'copies column D from "copper" to D4 of "Running Total"
      Sheets("RunningTotal").Range("E" & Nxtrw).Value = Sheets("Copper").Range("F" & Target.Row).Value ' copies column F from "copper to column E4 of "Running Total"
   End If
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,756
Members
448,990
Latest member
Buzzlightyear

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top