+ Reply to Thread
Results 1 to 10 of 10

Copy Cell Data to another sheet based on Cell Condition

  1. #1
    Registered User
    Join Date
    06-27-2020
    Location
    India
    MS-Off Ver
    365
    Posts
    24

    Copy Cell Data to another sheet based on Cell Condition

    Hello All,
    Request for guidance from the VBA Experts.

    I am having data in cells AS7 to AS7 of Sheet1.
    If AS7 is not blank, then corresponding cell in Column AT7 will show the status as "UPDATED"

    I want to create a macro with the following conditions:

    If AT7 = "UPDATED", then
    Copy AS7 from Sheet1 and paste the same to D7 of Sheet2.

    Please help.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,026

    Re: Copy Cell Data to another sheet based on Cell Condition

    Try:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    06-27-2020
    Location
    India
    MS-Off Ver
    365
    Posts
    24

    Re: Copy Cell Data to another sheet based on Cell Condition

    Thanks Mumps1. It works perfectly. Thanks again for the quick help.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,026

    Re: Copy Cell Data to another sheet based on Cell Condition

    You are very welcome.

  5. #5
    Registered User
    Join Date
    06-27-2020
    Location
    India
    MS-Off Ver
    365
    Posts
    24

    Re: Copy Cell Data to another sheet based on Cell Condition

    Hi Mumps1...even though your earlier solution worked perfectly, the same is not happenning when I give a range.
    Attached herewith the sample file with two sheets.

    If Col 'K' (any row) of "Stock Report" sheet is having the word "E COA", then, I want the data of different
    cells of that particular row to be copied to respective cells of Col 'D' of sheet "E COA". Similarly, if next
    row of Col 'K' of "Stock Report" sheet is having the word "E COA", then the data to be copied to respective
    cells of Col 'E" of sheet "E COA". Same for next row.

    Can you please help me out.

    Please don't think that I am simple asking for the help without putting any efforts. I could have done some
    R&Ds at my end too...however, I am unable to put my ideas in VBA mode. Please help.
    Attached Files Attached Files

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,026

    Re: Copy Cell Data to another sheet based on Cell Condition

    Your file has 11 sheets not 2. I don't see any instance of "E COA" in column K of the "Stock Report" sheet.
    I want the data of different cells of that particular row to be copied to respective cells of Col 'D' of sheet "E COA".
    Please clarify in detail exactly which cells in any particular row you want to copy and where exactly in sheet "ECOA" you want to paste them. Explain in detail using a few examples from your data referring to specific cells rows, columns and sheets. Attach a revised file that contains some instances of "E COA" in column K of the "Stock Report" sheet and the desired results in the "ECOA" sheet.

  7. #7
    Registered User
    Join Date
    06-27-2020
    Location
    India
    MS-Off Ver
    365
    Posts
    24

    Re: Copy Cell Data to another sheet based on Cell Condition

    Thanks Mumps1 and Good Morning.

    Attached herewith the sample file.

    Sheet "Stock Report"
    What I have done : Using "IF" function, (if Columns "A" to "I" is not blank and if Column "J" is having "E", Column "K" will show as "E COA"
    Using "IF" function, (if Columns "A" to "I" is not blank and if Column "J" is having "D", Column "K" will show as "D COA"

    What I would like to do: Once Column "K" indicates "E COA", the I would like to copy the data to sheet "E COA". E.g. If "K7" shows "E COA", then I want the data to be copied from:
    "E7" ("Stock Report" Sheet) to "D8" ("E COA" Sheet).
    "F7" ("Stock Report" Sheet) to "D9" ("E COA" Sheet).
    "G7" ("Stock Report" Sheet) to "D10" ("E COA" Sheet).
    "H7" ("Stock Report" Sheet) to "D11" ("E COA" Sheet).
    "I7" ("Stock Report" Sheet) to "D12" ("E COA" Sheet).

    The above rule is applicable if any of the cells of Column K (it can be K12 or K15 or K100) is having "E COA" word.
    If Col 'D' of "E COA" sheet is completely filled, then next row data of Stock Report Sheet should go to Column "E"
    of "E COA" sheet.

    Once Column "K" indicates "D COA", the I would like to copy the data to sheet "D COA". E.g. If "K7" shows "D COA",
    then I want the data to be copied from:
    "E7" ("Stock Report" Sheet) to "D8" ("D COA" Sheet).
    "F7" ("Stock Report" Sheet) to "D9" ("D COA" Sheet).
    "G7" ("Stock Report" Sheet) to "D10" ("D COA" Sheet).
    "H7" ("Stock Report" Sheet) to "D11" ("D COA" Sheet).
    "I7" ("Stock Report" Sheet) to "D12" ("D COA" Sheet).

    The above rule is applicable if any of the cells of Column K (it can be K12 or K15 or K100) is having "E COA" word.
    If Col 'D' of "D COA" sheet is completely filled, then next row data of Stock Report Sheet should go to Column "E"
    of "D COA" sheet.
    Attached Files Attached Files

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,026

    Re: Copy Cell Data to another sheet based on Cell Condition

    Try:
    Please Login or Register  to view this content.
    The formulae you have in column K of "Stock Report" are no longer necessary. The macro takes care of all the calculations.
    Last edited by Mumps1; 08-18-2021 at 08:50 AM.

  9. #9
    Registered User
    Join Date
    06-27-2020
    Location
    India
    MS-Off Ver
    365
    Posts
    24

    Re: Copy Cell Data to another sheet based on Cell Condition

    Wonderful Mumps1. Works perfectly. Thanks a lot. Unfortunately, I am unable
    to add "reputation" (forum rules don't allow it). Really grateful to you. Thank
    you again.

  10. #10
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,026

    Re: Copy Cell Data to another sheet based on Cell Condition

    You are very welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. copy data from two sheet to one sheet based on six condition
    By MKLAQ in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-19-2021, 05:25 PM
  2. [SOLVED] Copy data from one excel sheet to another based on condition
    By Dorababu in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-02-2015, 07:12 AM
  3. Need a macro to copy data from one sheet to another based on condition.
    By kishoremcp in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-21-2013, 01:56 AM
  4. [SOLVED] Copy Data Range to another sheet based on a condition.
    By psunursingguy21 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-30-2013, 03:50 PM
  5. [SOLVED] Macro to Copy Data from one Sheet A to Sheet B based on value in cell on sheet A
    By scass in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-11-2012, 07:21 PM
  6. [SOLVED] Copy data into another cell based on condition
    By SMILE in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-11-2012, 07:59 AM
  7. Automatically copy data from one worksheet to another based on cell condition
    By ptt87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2011, 01:38 PM

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