+ Reply to Thread
Results 1 to 10 of 10

Macro to copy data from one cell to another if adjacent cell meets certain requirements?

  1. #1
    Registered User
    Join Date
    02-19-2014
    Location
    Philadelphia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Macro to copy data from one cell to another if adjacent cell meets certain requirements?

    Hi,

    I'm new to the forum and a pretty basic excel user. I did some searches and tried a few of the scripts I saw but was unable to get them to do what I need.

    Basically I have three columns in a work Sheet F, G, & H. F is empty, G contains text and column H has both text and numbers.

    I want to be able to automatically copy the value from Cell H to Cell F if cell G contains the word cost.

    Thanks in advance!

    As a bonus question I would also like to delete all rows where Column G & H contain two dashes --

    Thanks!

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to copy data from one cell to another if adjacent cell meets certain requirement

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-19-2014
    Location
    Philadelphia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Macro to copy data from one cell to another if adjacent cell meets certain requirement

    Thanks. The first part of the script worked to delete the unwanted rows so that was awesome!

    The second part did not copy the data from Column H to column F, I'm not sure why not

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to copy data from one cell to another if adjacent cell meets certain requirement

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-19-2014
    Location
    Philadelphia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Macro to copy data from one cell to another if adjacent cell meets certain requirement

    For some reason the #'s are not copying to Column F from Column H. The rows are being deleted still which is a big help!

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to copy data from one cell to another if adjacent cell meets certain requirement

    Can you attach a sample with some data too test on? To attach a file, push the button with the paperclip (or scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.

  7. #7
    Registered User
    Join Date
    02-19-2014
    Location
    Philadelphia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Macro to copy data from one cell to another if adjacent cell meets certain requirement

    Wait - it works! It was my fault so I apologize. I did not realize this was case sensitive so Cost would not be recognized. I changed the case and it worked Perfectly! Thank you!

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to copy data from one cell to another if adjacent cell meets certain requirement

    You're welcome. Glad to help out and thanks for the feedback. Please comply with Forum Rule No. 9.

    9. Acknowledge the responses you receive, good or bad. If your problem is solved, please say so clearly, and mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved". Or click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Dropdown option or Edit button will not appear -- ask a moderator to mark it.

  9. #9
    Registered User
    Join Date
    07-07-2016
    Location
    St. Paul, Mn
    MS-Off Ver
    2007
    Posts
    4

    Re: Macro to copy data from one cell to another if adjacent cell meets certain requirement

    I am new to this form and I wanted to say a big THANK YOU for resolving my problem.
    Last edited by SPHINIX; 07-07-2016 at 11:22 PM.

  10. #10
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to copy data from one cell to another if adjacent cell meets certain requirement

    Welcome too the Forum SPHINIX. I'm glad you found it useful for your purposes. On the Forum appreciation is shown when click on the Add Reputation star at the bottom of the Post.

+ 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. Sum Up Cells Until Adjacent Cell Meets Criteria
    By cocostar88 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-27-2013, 02:41 PM
  2. Select cells if adjacent cell meets condition
    By nivivani in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-19-2012, 12:44 PM
  3. Link Partial Data To Cell If Data Meets Requirements
    By swordswinger710 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-20-2012, 10:47 AM
  4. Replies: 2
    Last Post: 02-13-2012, 08:22 AM
  5. Linking Partial Data From One Cell If Data In Another Cell Meets Requirements
    By swordswinger710 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 01-20-2009, 12:09 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