Copy the data from one sheet to another without empty rows

Radecki

New Member
Joined
Oct 23, 2013
Messages
17
Hi All,

You helped me in the past - hope you can guide me this time as well :)
Sorry I didnt know how to correctly title this post...

My issue:

In sheet 'one' I have a simple list of products with the price, etc.
Column 'C' is for quantity ('ILOŚĆ')
If I type specific quantity in the 'C' column, then the whole row is copied to the sheet 'two':

wn68u4I

https://imgur.com/A5ccAh8

What I am trying to achieve is to have the list in sheet 'two' with no blanks in between (for the products that I have not put any quantity).
Any idea how to have it listed with no empty rows?

https://imgur.com/V1YtAXm

I would lile it to look this way (without the need of manually hiding empty rows):

https://imgur.com/9uGcrRQ

I searched internet but I couldn't find any solution.
Please help.

Excel file can be downloaded here: http://s000.tinyupload.com/?file_id=02557717072149958749

Radek.
 
Last edited:

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Start by deleting all the formulas in range A5:H13 in sheet "2". Then copy and paste this macro into the worksheet code module. Do the following: right click the tab for your sheet "1" and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Enter a quantity in column C and exit the cell.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("C:C")) Is Nothing Then Exit Sub
    Application.ScreenUpdating = False
    Dim x As Long
    x = Sheets("2").Range("A4:A" & Sheets("2").Rows.Count).Cells.SpecialCells(xlCellTypeBlanks).Row
    Target.EntireRow.Copy
    Sheets("2").Rows(x).PasteSpecial xlPasteValues
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

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