Compile Data from Multiple Users based on Criteria

Curben

Board Regular
Joined
Aug 18, 2011
Messages
65
I have a few people all entering in data into excel, since they cannot be all in one sheet they each have their own copy. I would like to be able to extract all data where column P reads "Red" from each users spreadsheet and then delete the corresponding lines from their spreadsheet (end of day activity)

The Sheets will be named
FDEntryU1AM.xlsm
FDEntryU2AM.xlsm
FDEntryU3AM.xlsm
FDEntryU4AM.xlsm
FDEntryL1AM.xlsm
FDEntryU1PM.xlsm
FDEntryU2PM.xlsm
FDEntryU3PM.xlsm
FDEntryU4PM.xlsm
FDEntryL1PM.xlsm

I will then need to do the same in another workbook for all items Labeled Blue, but that of course will be same code with just an item replaced.
The idea is after they close up the person oversseing the data can import all at once and leave the users with fresh empty workbooks.

Any help would be appreciated
 
Yes you might also need a string line for the folder location for the workbooks which would have to be added. Something like:

Dim StrPath As String
set StrPath = "W:\Forms\FD User Entry Forms\"
Then in the Workbooks open you would use the StrPath, like this
Set myWorkbook = Workbooks.Open(FileName:=StrPath & avData(i) & ".xlsm")
 
Upvote 0

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
What about something like this then.
Code:
[FONT=Courier][COLOR=#00007f]Sub[/COLOR] Open_My_Files()
[COLOR=#007f00]'Open all workbooks and do something[/COLOR]
[COLOR=#00007f]Dim[/COLOR] MyFile [COLOR=#00007f]As[/COLOR] [COLOR=#00007f]String[/COLOR]
[COLOR=#00007f]Dim[/COLOR] ws [COLOR=#00007f]As[/COLOR] Worksheet
[COLOR=#00007f]Dim[/COLOR] myPath [COLOR=#00007f]As[/COLOR] [COLOR=#00007f]String[/COLOR]
myPath = "M:\Access Files\" [COLOR=#007f00]'Change path[/COLOR]
MyFile = Dir(myPath)

[COLOR=#00007f]Do[/COLOR] [COLOR=#00007f]While[/COLOR] MyFile <> ""
[COLOR=#00007f]If[/COLOR] MyFile [COLOR=#00007f]Like[/COLOR] "*.xls" [COLOR=#00007f]Then[/COLOR]
Workbooks.Open myPath & MyFile

[COLOR=#00007f]With[/COLOR] Sheets("Sheet1")
LR = .Range("p" & Rows.Count).End(xlUp).Row
[COLOR=#00007f]For[/COLOR] i = 1 [COLOR=#00007f]To[/COLOR] LR
[COLOR=#00007f]If[/COLOR] .Range("p" & i).Value = "Red" [COLOR=#00007f]Then[/COLOR] .Rows(i).Copy Destination:=Workbooks.Open("M:\Access Files\tblStaff Import.xls").Sheets("Staff").Range("A" & Rows.Count).End(xlUp).Offset(1) [COLOR=seagreen]'Change workbook name and sheet name[/COLOR]
[COLOR=#00007f]Next[/COLOR] i
[COLOR=#00007f]End[/COLOR] [COLOR=#00007f]With[/COLOR]

[COLOR=#00007f]Next[/COLOR] ws
ActiveWorkbook.Close [COLOR=#00007f]True[/COLOR]
[COLOR=#00007f]End[/COLOR] [COLOR=#00007f]If[/COLOR]
MyFile = Dir
[COLOR=#00007f]Loop[/COLOR]
[COLOR=#00007f]End[/COLOR] [COLOR=#00007f]Sub[/COLOR][/FONT]

While I never got this method to work right for this particular projext, I have been able to get it to work for a handful of others so i just wanted to make sure I came back and said thanks.
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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