This works but I don't know how to stop the loop (quit when it can't find "AR:") Thank you for any assistance
![]()
Please Login or Register to view this content.
This works but I don't know how to stop the loop (quit when it can't find "AR:") Thank you for any assistance
![]()
Please Login or Register to view this content.
Last edited by ker9; 06-16-2010 at 03:41 PM.
Hi ker9... Welcome to the forum.
Be sure to read through the Forum Rules so you can use and follow them effectively. For instance, you'll need to EDIT that post above and put code tags around that code you used. (Like shown here...)
![]()
Please Login or Register to view this content.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
Thank you - sorry about that. I believe I fixed the original message.
Your response is not quite what I'm after but I appreciate the help very much.
(FYI: "AR:" is only in column A)
After I find "AR:", I need to go over 1 column and copy cells from 8 columns (B:I)
Then go up one row and paste starting in column C (C:J)
Then I can delete the row that contains AR
If I find AR and I am in the AR cell, this takes care of the copy/paste/delete. But with your code I don't seem to be in the AR cell that was found. I hope this makes sense.
![]()
Please Login or Register to view this content.
Last edited by ker9; 06-16-2010 at 12:51 PM.
Thank you - sorry about that. I believe I fixed the original message.
Your response is not quite what I'm after but I appreciate the help very much.
(FYI: "AR:" is only in column A)
After I find "AR:", I need to go over 1 column and cut cells from 8 columns (B:I)
Then go up one row and paste starting in column C (C:J)
Then I can delete the row that contains AR - or I supposed I could delete this after I do all the cutting and pasting
If I find AR and I am in the AR cell, this takes care of the copy/paste. But with your code I don't seem to be in the AR cell that was found. I hope this makes sense.
![]()
Please Login or Register to view this content.
Last edited by ker9; 06-16-2010 at 12:51 PM.
1) Please edit your prior posts and use CODE tags, not quote tags. Just edit them and change the word QUOTE to CODE in the tags. Thanks.
2) I was really just trying to answer your specific question "how to loop for AR and stop when it's not found anymore". I assumed you would edit the code for the activities since I didn't exactly understand that part in your code.
Now that you've explained it this one line of added code will do the copy/paste:
![]()
Please Login or Register to view this content.
3) You'll note the absence of selecting and activecell and such. Only humans need to select a cell before acting on it. In VBA, you can refer to cells and ranges directly and act on them directly without selecting at all.
I'm using a range variable to spot the "AR:" cells, so when it's found the address of the cell is stored in that variable and we can offset from there without selecting.
In general, you want to remove as many physical references as you can.
OK, I've edited them again. For the record, the instructions say use the # button at the top of the post, which I never found until I realized I needed to click "Go Advanced" to see more options.
THANK YOU! That is exactly what I wanted to do. I really appreciate your help and the time you took to work with me on this. I'm learning (slowly, but ...) (I've been searching the web for 3 hours trying to find a solution and trying different things before asking the question)
Thank you Thank you Thank you
Karin
My pleasure, glad to help. The 3 hours is well spent if you end up with:
1) The correct solution to the problem at hand
2) A new resource for getting more correct solutions in the future
===========
If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
Hi, Again - can you tell me how to get it to look only in column B (for find) (but not be restricted to B for copy/paste) ?
Thank you.
You can control what gets searched in the RANGE reference underlined here:
![]()
Please Login or Register to view this content.
It doesn't work when I do that (and yes I made sure I had the correct column to find it) It only works when it starts with "cells" as in the original.
EXCEPT - if I change: After:=[A1] to After:=[B1]
Then it works
Thank you again - You're wonderful!!!
Last edited by ker9; 06-16-2010 at 03:18 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks