How do you populate data in Excel from another sheet based on cell value?

How do I automatically pull data from one Excel sheet to another?

I have a master list of about 400 different items.

For example -
Master List. ItemCode I have the master list created, but my problem is how to I pull these items in automatically on a weekly basis? Can I have some sort of daily automated import for each week? Please advise. Ideally, if you look at the example above, I would want to pull that new Data Import sheet name "Data Imports", and create a new data sheet with exactly the same columns as "Master List", so that I am able to run my calculations across all of them. This is not a one time thing, so if we are using this type of method, is there any way we can set up a macro to check every other Sunday, and "pull" the master list and add it to the new "Data Imports" sheet? I guess what I am asking is, if you have 400 different items, and I only want it to do the calculations once a week, is there a way to get it to run once per week, but have it pull the new list, and add that to the worksheet the next week, while maintaining my calculation across both of these sheets? Is this possible? Thanks for any advice! PS: I have used Excel on a fairly large scale, but never on something like this. Thanks for any assistance! Yes, you can make an array which contains the values from each of your excel files and then check the dates. Using the date format YYYY-MM-DD you can make a formula that checks the previous week against the current week. This will evaluate to 0 if the current week is the same as the previous week and whatever cell in the range D2 to D3991 which is the last week value for that given cell/row else it will return the value of the excel file to the one before last week.

How do you populate data in Excel from another sheet based on cell value?

My first example will just add the next row if the value in A1 is 1 and then do the same for A2.


Function Sum(RangeA As Range, Val As String) As Double. Dim ws As Worksheet. Set ws = Sheets("MyNewSheet"). Dim lrow As Long. lrow = ws.Range("A" & ws.Rows.Count).End(xlUp).Row

For I = 1 To 10. If ws.Range("A" & i) = Val Then lrow = i.e. Exit For. End If. Next. Sum = ws.Range("C" & lrow) End Function. Sub Sum1(). Range("A1:A10").Formula = "=Sum(A1,A2)" End Sub. Sub Sum2(). Range("A1:A10").Formula = "=Sum(A1:A3)" Sub Sum3(). Range("A1:A10").Formula = "=Sum(A1:A10)" I want to populate a range of cells say B1:D10 with all the values in Sheet1 that are in the range A1:A10. Sub Sum4(). 'Code in here. The example shown above will populate values in range B1:D10 with all the values in range A1:A10, when the value is 1 for all rows in A1:A10. But I want it to add all the values from row 1-10 in a sum in A11.A20. I tried to get this correct by setting values to =Sum(A1,A2).

Related Answers

What does enable content mean Excel?

I'm working with a colleague that is an excellent Excel user and also a v...

Why won't macros work in Excel on Mac?

Macro (aka VBA) can be used to execute code automatically in Excel. This...

How do I use a cell value as a variable in VBA?

I have a cell in Excel which stores the value I want. Now I want...