Automatically Populating fields based on 1 criteria

kelmack

New Member
Joined
Feb 20, 2011
Messages
1
Hi,

I have two worksheets in the same book, where the 2nd sheet is my data and I want the first sheet to automatically populate the cells if I enter a value in the 2nd sheet.

Eg.Sheet 2

Column A Column B Column C Column D Column E Column F
Code Description Price Total Qty Boat 1 Boat 2

40000 TC Angel Shark $12.90 50 20 30
40001 TC Blue Eye
40002 TC Ling $10.90 60 60

On sheet 1, I basically want to populate cells with the above information only if there is a value in column D, blank values need to be skipped, so that I get a summary of sheet two for all items where there is a value in Total Qty.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi,

I have two worksheets in the same book, where the 2nd sheet is my data and I want the first sheet to automatically populate the cells if I enter a value in the 2nd sheet.

Eg.Sheet 2

Column A Column B Column C Column D Column E Column F
Code Description Price Total Qty Boat 1 Boat 2

40000 TC Angel Shark $12.90 50 20 30
40001 TC Blue Eye
40002 TC Ling $10.90 60 60

On sheet 1, I basically want to populate cells with the above information only if there is a value in column D, blank values need to be skipped, so that I get a summary of sheet two for all items where there is a value in Total Qty.


Does this help?

Code:
Sub Kelmack()
'
'
Dim lr As Long

lr = Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Row

With Sheets("Sheet2")
'
    .Range("D1:D" & lr).AutoFilter Field:=1, Criteria1:="<>"
    .Range("A1:G" & lr).SpecialCells(xlCellTypeVisible).EntireRow.Copy Sheets("Sheet1").Range("A1")
    .Range("D1:D" & lr).AutoFilter
    
End With

End Sub
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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