Consulting

Results 1 to 12 of 12

Thread: How to move from one sheet to otherby condition?

  1. #1

    Exclamation How to move from one sheet to otherby condition?

    I need to move the name and surename from sheet1 to empty column in sheet2 by a condition: personal code.
    If code match, first two line (name and surename from sheet1) update empty fields in sheet2 right to the same personal code.Is this possible?

    Manually without compare and update functions, look like this :

    [vba] Range("D9").Select
    Sheets("Sheet2").Select
    Range("D5").Select
    Sheets("Sheet1").Select
    Range("B9:C9").Select
    Range("C9").Activate
    Selection.Copy
    Sheets("Sheet2").Select
    Range("A5:B5").Select
    ActiveSheet.Paste
    Sheets("Sheet1").Select
    [/vba]

    Document attached
    Attached Files Attached Files

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    =INDEX(Sheet1!B:B,MATCH($D3,Sheet1!$D:$D,0))
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3

    Exclamation error

    Quote Originally Posted by mdmackillop
    =INDEX(Sheet1!B:B,MATCH($D3,Sheet1!$D:$D,0))
    i cant figure up, get a error "9" out of range, please attach your example on my test.xlsm file

  4. #4
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    See attached
    Attached Files Attached Files
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5

    reply

    Quote Originally Posted by mdmackillop
    See attached
    thank you, i see that you want to help me, but im not very god in excel progr. i miss something?

    i43.tinypic.com/352rnll.jpg

  6. #6
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    I don't see the need for VBA here. Am I missing something?
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  7. #7
    Quote Originally Posted by mdmackillop
    I don't see the need for VBA here. Am I missing something?
    look at the picture
    i43.tinypic.com/352rnll.jpg
    a error occurred waht version of excel do you use?

  8. #8
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    What result did you expect to see for those cells? There is no corresponding number.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  9. #9
    i see now but my original sheets contain more than 3000 name's inserted i have to insert manualy the function on each line or this can be done automaticaly?

  10. #10
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Personally, I would do it manually. It only takes two clicks.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  11. #11
    two clicks in each row, or select the column?

  12. #12
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Use the Fill Button
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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