Hi,
I need a macro to copy and paste cells from one worksheet to another, if there is the word true in the column L of that row.
Can anybody help?
Thanks in advanced!
Hi,
I need a macro to copy and paste cells from one worksheet to another, if there is the word true in the column L of that row.
Can anybody help?
Thanks in advanced!
I'd go with something like :
Please Login or Register to view this content.
=IF(AND(OR(BLONDE,BRUNETTE,REDHEAD),OR(MY PLACE,HER PLACE),ME),BOW-CHICKA-BOW-WOW,ANOTHER NIGHT ON THE INTERNET)
Hi, thanks for the reply. I'm not that savvy with Macros, what do x and y mean?
My apologies.
Horrible habit of mine.
At the start of the code, you see:
Dim x as integer
Dim y as integer
This is declaring them as integers (Whole numbers) telling excel that these are numbers. In this case I'm using x as the reference to the page already containing the data, and y as the reference for the page it's going to.
Basically this code says:
x and y are numbersPlease Login or Register to view this content.
y is 1 to start withPlease Login or Register to view this content.
for x = 1 to 10000 means it runs this next chunk of code for every number in between and including 1 and 10000.Please Login or Register to view this content.
So it starts with x = 1.
It's saying in the next line if cells(x, 12) x is 1, so cells(1, 12) which is column L, row 1... if that is TRUE then...
copy row x (1), column A : column L from that worksheet, to this other worksheet, in range row y (y = 1 at the start of this code), column A to L. Once that's done, it increases y by one, meaning the next time it copies over, it'll be on the next line down, since y is then 2, then 3, etc. But only if it's copied something, since it's tucked in as part of the IF-END IF nest.
Once this completes for the first x (1), it goes to the next x which is 2, so it runs those checks on row 2, and so on and so forth, up to row 10000.
I just kinda pulled 10000 out of the air, you can set that to whatever you'd like, or we can set something up that figures out its own range.
mew?
Last edited by mewingkitty; 12-04-2009 at 03:50 PM.
Hi, I'm still a little bit lost.
Here's a screenshot:
The highlighted area is what I'd like to copy, and I'd like it to be copied exactly from Sheet1 to Sheet2. Does this help?
Thanks
\1
Pink characters have been changed.
If you could post your actual workbook, or an example of it, instead of just a picture, I can implement this for you along with a more detailed explanation of what's happening and why.Please Login or Register to view this content.
Ok, I've just removed all the data, I'll upload the file.
I'd pretty much like those that say TRUE to be copied to Sheet 2, with the first TRUE being first, and the others below that, with no gaps, if that makes sense? Haha.
Thanks
See attached.
There's a brief explanation of how to access the code and run it step by step in the worksheet. I think that should clear up any questions you have about further tweaking it?
Lemme know.
mew!
Awesome, think I've got the gist now, many thanks!
I smiled when I read the last post!
After reading all of this, I understood alot more about how code works.
Could this be method be implemented in my current problem:
See topic - Search another worksheet
could your code be modified to search say, Workbook DATABASE ,Column A, row 1 - 5000,
for any instance / combination of
Workbook FORM , cell H20? (or whatever cell it is)
If there is any matches / close matches?
does the 'close match' bit make it more difficult as its not an exact match?
Hope you can give some advice.
Cool cool.
Please mark your thread as solved!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks