+ Reply to Thread
Results 1 to 8 of 8

How to move the contents of one cell based on the contents of another cell:

  1. #1
    Registered User
    Join Date
    07-12-2014
    Location
    North Carolina
    MS-Off Ver
    Office 2007
    Posts
    79

    How to move the contents of one cell based on the contents of another cell:

    Hello All,

    I think this one will be pretty straightforward, but I can't figure it out.

    I知 trying to build a macro that would complete the following task:
    If cell A2 has a value (text or numbers)= move the contents of B3 to cell C2.

    For this example I知 using specific cells, but this would need to be repeated throughout the spreadsheet, so if it could complete the movement based on the relative position of cells instead of specific cells, that would be awesome. The columns will always be the same; which rows it is applied to will not always be the same.

    Also, does anyone here know a good place to start learning how I could this stuff myself? I知 pretty good at editing code I find, but not building it from scratch. I want to be more self-reliant. J

    Unfortunately I have to post this from an iPad so I can't attach a sheet, but I hope it's straightforward enough without it.

    Thanks in advance,

    Chad

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: How to move the contents of one cell based on the contents of another cell:

    try this code
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: How to move the contents of one cell based on the contents of another cell:

    move the contents of B3 to cell C2
    It is really B3 to C2 or is that a mistype?

  4. #4
    Registered User
    Join Date
    07-12-2014
    Location
    North Carolina
    MS-Off Ver
    Office 2007
    Posts
    79

    Re: How to move the contents of one cell based on the contents of another cell:

    Stnkynts- yes it is B3 to C2 - it's not a mistype. Thanks for checking.

    Yassirkhalil- thanks for providing that. I'm trying to get the code you provided to work, but I get a syntax error at the "Cut Target" part. Any thoughts?

    Also, can I incorporate this into a bigger macro, or does it need to be standalone?

  5. #5
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: How to move the contents of one cell based on the contents of another cell:

    Also, can I incorporate this into a bigger macro, or does it need to be standalone?
    Do you want to have the macro trigger when you enter a value into a cell in column A, or do you want to be able to run a standalone routine that loops through all of column A?

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: How to move the contents of one cell based on the contents of another cell:

    Please post a sample workbook
    I tested my code and it worked very well with no errors

  7. #7
    Registered User
    Join Date
    07-12-2014
    Location
    North Carolina
    MS-Off Ver
    Office 2007
    Posts
    79

    Re: How to move the contents of one cell based on the contents of another cell:

    Yassir- I think it was user error. I made a few changes and it's working now. Thanks so much!

  8. #8
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: How to move the contents of one cell based on the contents of another cell:

    Great
    Glad to help you and thanks for the feedback
    Don't forget to mark the thread as solved

+ 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. Move cell based on contents (VBA)
    By BaronDJB in forum Excel General
    Replies: 5
    Last Post: 12-21-2014, 11:24 AM
  2. Macro to move row based on cell contents
    By alpha608 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2013, 04:08 AM
  3. [SOLVED] Move contents of a cell based on contents of another cell
    By djfscouse in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-06-2012, 10:31 AM
  4. Move cell value from one column to another based on contents
    By uncleslinky in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2011, 06:44 AM
  5. Replies: 1
    Last Post: 07-01-2005, 10:57 AM

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