+ Reply to Thread
Results 1 to 20 of 20

Help with Multiple IF to copy info from specific cells to another workbook conditonal

  1. #1
    Registered User
    Join Date
    01-24-2013
    Location
    Shepparton, Australia
    MS-Off Ver
    Excel 2010
    Posts
    23

    Help with Multiple IF to copy info from specific cells to another workbook conditonal

    Hi
    In a workbook called Client List for all FMP workers I need the following to happen.

    If a 1 entered into the B column
    Then if 1 entered into the 18 column
    Then copy information from the A column of the same row to the next available cell in the 7 row on the first worksheet of another workbook called IM Client Data new template and the information from the F1 cell into the 9 row below the previous info. (The both workbooks are opened at the same time when either is opened)
    Then if
    If a 1 entered into the C column
    Then if 1 entered into the 18 column
    Then copy information from the A column of the same row to the next available cell in the 7 row on the second worksheet of another workbook called IM Client Data new template and the information from the F1 cell into the 9 row below the previous info.
    Then If
    If a 1 entered into the D column
    Then if 1 entered into the 18 column
    Then copy information from the A column of the same row to the next available cell in the 7 row on the Third worksheet of another workbook called IM Client Data new template and the information from the F1 cell into the 9 row below the previous info.
    Then If
    If a 1 entered into the E column
    Then if 1 entered into the 18 column
    Then copy information from the A column of the same row to the next available cell in the 7 row on the forth worksheet of another workbook called IM Client Data new template and the information from the F1 cell into the 9 row below the previous info.

    The following code copies the information from the whole row if a 1 is entered into the 21 column and pastes it into the next available row of the closed worksheet and then deletes the row from the original page and then if a 1 is entered into the 19 column the row is copied to the DHS Client List worksheet.

    This code works fine just need to add the above to it

    Please Login or Register  to view this content.
    If someone is able to help it would be greatly appreciated.
    Thanks, oldboots

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Help with Multiple IF to copy info from specific cells to another workbook conditonal

    Not so bad once started - let's see if it works:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    01-24-2013
    Location
    Shepparton, Australia
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Help with Multiple IF to copy info from specific cells to another workbook conditonal

    Hi xladept,
    Thanks for your help. I copied and pasted the code you wrote and it is having a couple of errors in it. I ran your code in the first worksheet of the workbook "Client List for all FMP Workers" the sheet name is "Judi" You can see the code in the next three pages works fine. in the other three pages If you enter enter a 1 into the 21 column it cuts the row and places it into the next available row of the closed page. if you enter a 1 into the column it copies the row into the DHS Client List page. I have attached the two workbooks for you to see how it works. If you are able to have a look at the two workbooks and then what I wrote above hopefully it will make sense.

    I look forward to your reply,
    regards, oldboots
    Attached Files Attached Files

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Help with Multiple IF to copy info from specific cells to another workbook conditonal

    Hey oldboots - you didn't post the whole routine - maybe I don't understand??

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-24-2013
    Location
    Shepparton, Australia
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Help with Multiple IF to copy info from specific cells to another workbook conditonal

    Hi xladept,

    Please forgive my for being an idiot. Not copying all the code what can I say, you just got to laugh

    I have copied the whole routine now and it still has a couple of errors. If you look at the first section of code that I posted at the top of the post you can see that if a 1 is entered into the 21 (U) Column it then copies the whole row and places the information into the worksheet named Closed on the next available row and then deletes the original row. Then the code goes on and if a 1 is entered into the 19 (S) column then it copies the row into the worksheet named DHS Client List so that the information is in both worksheets. This is all in the workbook named "Client List for all FMP Workers". You can see that the code runs on the first four worksheets.

    The next part is to copy information from the "Client List for all FMP Workers" to the "IM Client Data new template" if you look at the worksheet names of the first four worksheets in the "IM Client Data new template" workbook you will see that they are the same as the B, C, D & E columns of the first four worksheets of the "IM Client Data new template" workbook. What happens is a 1 is entered into either the B, C, D, or E column that then indicates which worksheet the information gets copied into in the "IM Client Data new template" workbook. The information gets copied when a 1 is entered into the 18 column. If a 1 is not entered into the 18(R) column then nothing happens. When the 1 is entered then The information that needs to get copied is from the 1 or (A) column of the "Client List for all FMP Workers" workbook to the 7 row of the appropriate page in the "IM Client Data new template" workbook and the information from the F1 cell to the 9 row of the same worksheet in the same column as the info in the 7 row.

    I have attached the workbooks again for your information.

    I hope that this make sense.
    Thanks again.
    Attached Files Attached Files

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Help with Multiple IF to copy info from specific cells to another workbook conditonal

    I'm not sure but perhaps the more explicit set??

    Please Login or Register  to view this content.
    The thing is, I'm not sure what it's doing that it shouldn't be and what it should be doing that it isn't Never mind that - see if this does the trick
    Last edited by xladept; 02-20-2013 at 03:22 PM.

  7. #7
    Registered User
    Join Date
    01-24-2013
    Location
    Shepparton, Australia
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Help with Multiple IF to copy info from specific cells to another workbook conditonal

    Hi xladept,

    Thanks again for your help. I have posted the whole routine again and it is not working, non of the actions worked. It appears that I am not doing a good job getting my message the right way, thank you for being patient with me. The first code that I posted when I started this thread is the code that works the events on the attachment "Screenshot 3". If we look at it one step at a time we can forget about this action as I have the code to make it work. If you look at the attachment "screenshot 1" It might explain what it is that I need to happen and then "Screenshot 2" show where the info needs to be pasted in the other workbook. These are screenshots of the area that the code needs to work for in the two workbooks that I previously attached.

    Look forward to hearing from you soon.
    regards, oldboots
    Attached Files Attached Files

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Help with Multiple IF to copy info from specific cells to another workbook conditonal

    Hi Old Boots,

    I've just perused your screenshots but you need to tell me what's not happening on your end because I thought that that was what the routine effected - I've been busy today but I'll examine it again tomorrow.

  9. #9
    Registered User
    Join Date
    01-24-2013
    Location
    Shepparton, Australia
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Help with Multiple IF to copy info from specific cells to another workbook conditonal

    Hi xladept,

    I have been through and the following is what is not happening. Please do it when you can, I appreciate your help when you can is fine.

    In the workbook "Client List for all FMP workers" When a 1 is entered into the U "Closed" column pop up box with message Run-time error '9': Subscript out of range.Does not cut row and place it in next available row of closed worksheet on the same workbook.

    When 1 entered in S "Portal Referral" column, no error but it does not copy the row into the DHS Client List worksheet in the next available row of the same workbook.

    When 1 entered into the B non income column and then a 1 is entered into the R enter stats column the UR number from the A UR column and the name from the F1 cell is not copied to the next available column in the 7 and 9 rows respectively in the 1st worksheet of the IM Client Data new template workbook. (Both workbooks are opened before this action is tried).

    When 1 entered into the C Vulnerable IM column and then a 1 is entered into the R enter stats column the UR number from the A UR column and the name from the F1 cell is not copied to the next available column in the 7 and 9 rows respectively in the 2nd worksheet of the IM Client Data new template workbook.

    When 1 entered into the D Child Pro IM column and then a 1 is entered into the R enter stats column the UR number from the A UR column and the name from the F1 cell is not copied to the next available column in the 7 and 9 rows respectively in the 3rd worksheet of the IM Client Data new template workbook.

    When 1 entered into the E Voluntary IM column and then a 1 is entered into the R enter stats column the UR number from the A UR column and the name from the F1 cell is not copied to the next available column in the 7 and 9 rows respectively in the 4th worksheet of the IM Client Data new template workbook.

    I look forward to getting your reply over the next few days when you have some spare time is fine.

    regards, oldboots
    Last edited by oldboots; 02-22-2013 at 07:45 AM.

  10. #10
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Help with Multiple IF to copy info from specific cells to another workbook conditonal

    Hi Old Boots,

    Try this:

    Please Login or Register  to view this content.

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Help with Multiple IF to copy info from specific cells to another workbook conditonal

    Here it is with a subroutine:

    Please Login or Register  to view this content.

  12. #12
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Help with Multiple IF to copy info from specific cells to another workbook conditonal

    Here it is with a true subroutine:

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    01-24-2013
    Location
    Shepparton, Australia
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Help with Multiple IF to copy info from specific cells to another workbook conditonal

    Hi xladept,

    I have tried all three routines and I'm afraid that they are all the same as I wrote above. The all create the one runtime error. I made sure that I copied the whole of the routines and saved them and then closed the workbook before opening it again to make sure that the code was saved correctly etc.

    thanks, Oldboots

  14. #14
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Help with Multiple IF to copy info from specific cells to another workbook conditonal

    Client list for all FMP Workers.xlsIM Client Data new template.xlsm

    Here's what I've got and it runs as expected - I think!

    The Subscript error could be in the naming of the books or sheets??

    Are you only going to use the event in Judi or will you be using it in the other sheets??

  15. #15
    Registered User
    Join Date
    01-24-2013
    Location
    Shepparton, Australia
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Help with Multiple IF to copy info from specific cells to another workbook conditonal

    Hi xladept,

    In answer to your question yes the event is going to be used in four worksheet, Judi, Äurelia, Ian and Grant. If you look at the F1 cell in these worksheets there is a formula that takes the name of the tab and makes it the same in other areas throughout the workbook. This means that when a worker leaves employment and a new worker starts the new workers name is entered on the tab and the rest of the worksheets are updated, at the moment the sheets are Judi, Auralia, Ian and Grant.

    I downloaded both the workbooks that you attached and saved them as macro enabled workbooks and I'm afraid that I cannot get any of the expected functions to work. I tried them all and nothing happened and there were no errors.

    I did notice where you had got the Ur number and name to copy into the 1st worksheet of the IM Client Data new template workbook that the rows are correct and in the correct place but the name that needs to be copied is not from the same row as the UR number but the workers name from the F1 cell of the four worksheets with the workers names. That is why I explained about the tab names above.

    Hope this all makes sense.

    regards, oldboots
    Last edited by oldboots; 02-24-2013 at 04:57 AM.

  16. #16
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Help with Multiple IF to copy info from specific cells to another workbook conditonal

    Well, Old Boots, I put the code in the Workbook module and made the F1 change (sorry about that) and now it all works nicely, as advertised on my system - here it is: Client list for all FMP Workers.xls

    in the true subroutine( GoSub...Return) this code yields better results:

    Please Login or Register  to view this content.
    Last edited by xladept; 02-24-2013 at 03:57 PM.

  17. #17
    Registered User
    Join Date
    01-24-2013
    Location
    Shepparton, Australia
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Help with Multiple IF to copy info from specific cells to another workbook conditonal

    Hi xladept,

    I don't know what it is that I am doing wrong I have downloaded the workbook and see where you put the code in workbook module. I saved the workbook into a test folder on my desktop as a macro enabled file and opened it up and it does nothing for me. I have been in through the developer tab into macro security and allowed all actions and added the folder on my desktop to trusted locations. So I am at a loss.

    Sounds like you are having no problems with it, maybe we should all move to LA then it will work for us? Oh that's no good cost to much to get all out clients over there!

    Don't know what to say.................

    regards, Oldboots

  18. #18
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Help with Multiple IF to copy info from specific cells to another workbook conditonal

    Hi Old Boots,

    Maybe if you run this:

    Please Login or Register  to view this content.

  19. #19
    Registered User
    Join Date
    01-24-2013
    Location
    Shepparton, Australia
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Help with Multiple IF to copy info from specific cells to another workbook conditonal

    Hi xladept,

    well I included the sub that you sent into the workbook module at the start of the module saved it etc and I sorry to say It does not do one thing for me. I don't know what else there is, I am at a loss. It is not even coming up with an error that I can try and trace though.

    Hope you have an idea.

    regards, oldboots

  20. #20
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Help with Multiple IF to copy info from specific cells to another workbook conditonal

    Hi Old Boots,

    I hope that you ran that sub. I don't know what to say now except, here they are again:

    Client list for all FMP Workers.xls IM Client Data new template.xlsm

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1