separation of data

alireza123456

New Member
Joined
Aug 3, 2016
Messages
23
Hi
I have a large number of factory data in different sheets and wish separate a specified factory data. please guide me.
for example:
sheet1:
factorysaleincomework day
a102005
b203006
c153005
d55004

<colgroup><col width="70" span="4" style="width:53pt"> </colgroup><tbody>
</tbody>

sheet2:
factorysaleincomework day
b101003
d125004
a142005
f133006
h104005

<colgroup><col width="70" span="4" style="width:53pt"> </colgroup><tbody>
</tbody>

sheet 3:
factorysaleincomework day
a102005
c203004
f304006
a52005

<colgroup><col width="70" span="4" style="width:53pt"> </colgroup><tbody>
</tbody>

i want:
factorysaleincomework day
a102005
a142005
a102005
a52005

<colgroup><col width="70" span="4" style="width:53pt"> </colgroup><tbody>
</tbody>
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hi
I have a large number of factory data in different sheets and wish separate a specified factory data. please guide me.
for example:
sheet1:
factorysaleincomework day
a102005
b203006
c153005
d55004

<tbody>
</tbody>

sheet2:
factorysaleincomework day
b101003
d125004
a142005
f133006
h104005

<tbody>
</tbody>

sheet 3:
factorysaleincomework day
a102005
c203004
f304006
a52005

<tbody>
</tbody>

i want:
factorysaleincomework day
a102005
a142005
a102005
a52005

<tbody>
</tbody>
This quesion also come in :

separation of data
 
Upvote 0
Hello Alireza,

Perhaps the following code will do the task for you:-

Code:
Sub SearchShts()

Application.ScreenUpdating = False

        Dim lr As Long
        Dim fSearch As String
        Dim ws As Worksheet
        Dim cell As Range

fSearch = Sheet1.Range("F1").Value

For Each ws In Worksheets
        If ws.Name <> "Master" Then
        
For Each cell In ws.Range("A2:A" & ws.Cells(Rows.Count, "A").End(xlUp).Row)
                 If cell.Value = fSearch Then
                 lr = Sheet1.Range("A" & Rows.Count).End(xlUp).Row + 1
                 cell.EntireRow.Copy
                 Sheet1.Range("A" & lr).PasteSpecial xlPasteValues
                 Sheet1.Range("E" & lr).Value = ws.Name
                 End If
             Next
       End If
Next ws

Sheet1.Range("F1") = "SEARCH"
Sheet1.Select
Application.CutCopyMode = False
Application.ScreenUpdating = True

End Sub

The code checks a search box in cell F1 (in the Master sheet) for a value selected from a drop down list and then searches all sheets for that value. It then transfers all the relevant data related to that value to the Master sheet.
The source sheet is also placed in Column E of the Master sheet.

Following is the link to my test work book. Select a value from the drop down in the search box then click on "GO" to see it work.

https://www.dropbox.com/s/3x4w8sniphym8mz/Alireza(multi shts to master sht).xlsm?dl=0

I hope that this helps.

Cheerio,
vcoolio.
 
Upvote 0
very very thanks Cheerio
if i add a row to sheet 1 :
W 10 100 5
then w don't add to search cell in master sheet.
what is your suggestion?
:)
 
Upvote 0
Hello Alireza,

In the code above, sheet1 is the "Master" sheet so you shouldn't be adding anything to it. But I do assume that you mean the source sheets.
So, back in the Master sheet, you need to add W to the data validation drop down. It will then work.

Cheerio,
vcoolio.
 
Upvote 0
i have changed name in sheet 2 :4
but search in master has not change

a to ali
b to baba
...
 
Last edited:
Upvote 0
very very thanks Cheerio
if i add a row to sheet 2 :
W 10 100 5
then w don't add to search cell in master sheet.
what is your suggestion?
 
Upvote 0
As I said in post #5 above, you need to add the W to the data validation drop down list which is in cell F1 in the sample I supplied.

Cheerio,
vcoolio.
 
Upvote 0
thanks, i understand now.
pardon me. i am novic.
Did you mind if i have simple questio.
who i can use this macro in other worksheet?

please notice i'm novic. if you have time, please tell me step by step.
 
Upvote 0
Hello Alireza,

I will do that for you but later today/tonight. In the meantime, could please upload a sample of your actual work book to a free file sharing site (such as DropBox) and then post the link to your file back here. Please use dummy data.

Cheerio,
vcoolio.
 
Upvote 0

Forum statistics

Threads
1,215,347
Messages
6,124,421
Members
449,157
Latest member
mytux

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