Find and Copy all Specific Information from one Sheet to another sheet

cpassons

New Member
Joined
Jun 30, 2007
Messages
25
Hello All-

I have searched the WWW and I can't seem to find exactly what I am looking for, so I am hoping someone here can help. I know enough about Excel to be dangerous so if you know how to help me please give me step by step details. So here is my problem:

On my first sheet I have a lot of data. I want a formula or something to look at it and find all of a specific data and copy it and all the information from the whole row onto a specific sheet. I hope the following example can clarify.

For example, if my first sheet is named "All Cases", and I have another sheet named "4". I want a formula or something to find ALL the "4" in column C of "All Cases" and copy them to my sheet named "4". Not only the information from column c but from a, b, d, e, f, g as well. And to do this automatically.

I hope this is clear as mud....
 
Add this line as shown
Code:
    For i = 2 To Lastrow
     [COLOR=#0000ff] Debug.Print "|" & Cells(i, "C").Value & "|", Evaluate("isref('" & Cells(i, "C").Value & "'!A1)")[/COLOR]
        Lastrowa = Sheets(Cells(i, "C").Value).Cells(Rows.count, "C").End(xlUp).Row + 1
        Rows(i).Copy Sheets(Cells(i, "C").Value).Rows(Lastrowa)
    Next
Then in the vbe look to see if the Immediate window is open (normally below the code window) Ctrl G will open it if needed. When it's open run the code & when it fails copy & Paste the last line in the immediate window to the thread

Sorry this doesn't make any sense. I am new to VBE ........
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Which part doesn't make sense? Just part of it, or all of it?
 
Upvote 0
The line in blue is the line you need to add to the code that My Aswer Is This supplied in post#6
The other lines in the code from post#20 are there simply to show you where you need to add the new line.
 
Upvote 0
The line in blue is the line you need to add to the code that My Aswer Is This supplied in post#6
The other lines in the code from post#20 are there simply to show you where you need to add the new line.

So I followed your directions and the last line in the Immediate window was this:

|3 and 2 | False

But it highlighted this in my script

Lastrowa = Sheets(Cells(i, "C").Value).Cells(Rows.Count, "C").End(xlUp).Row + 1


Hope this helps .....I really appreciate everyone helping. I thought this was going to be a simple formula, but am learning new stuff.
 
Upvote 0
Do you have a sheet called "3 and 2 "? Note the space after the 2.
 
Upvote 0
Do you have a sheet called "3 and 2 "? Note the space after the 2.

So on my main sheet I found the "3 and 2" in column see. I should have been one or the other. I made the change and reran the script and now in the Immediate window I get:

Error 2015

On the last line.
 
Upvote 0
Do you have formulae in col C? or any values like #N/A, #Value etc
 
Upvote 0
Hello again-

I went through all of Column C on my first sheet named "All Cases". I didn't find any formulas, or NA or VALUE. I did find a blank cell. I don't know if this would have caused it.
 
Upvote 0

Forum statistics

Threads
1,223,703
Messages
6,173,983
Members
452,540
Latest member
haasro02

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