+ Reply to Thread
Results 1 to 9 of 9

Macro to cut and paste dependent on cell value

  1. #1
    Forum Contributor
    Join Date
    03-08-2011
    Location
    London
    MS-Off Ver
    Work Office 365 Home 2019
    Posts
    428

    Macro to cut and paste dependent on cell value

    Hi Guys,

    Trying to help someone else on here and have got so far but now got stuck so I need some help myself! I'm looking for a macro to achieve the following:

    if E5 = "A" Copy O17 and Paste as value into D27
    if E5 = "B" Copy O17 and Paste as value into E27
    if E5 = "C" Copy O17 and Paste as value into F27
    if E5 = "D" Copy O17 and Paste as value into H27 (note H27 not G27)
    if E5 = "E" Copy O17 and Paste as value into I27
    if E5 = "F" Copy O17 and Paste as value into J27

    I'm sure it's basic, but any help would be appreciated.

    Ta!

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,924

    Re: Macro to cut and paste dependent on cell value

    Try this

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    03-08-2011
    Location
    London
    MS-Off Ver
    Work Office 365 Home 2019
    Posts
    428

    Re: Macro to cut and paste dependent on cell value

    Very close Alan, and thank you for your efforts.

    However, it's putting it in the formula, I need it to put in the value

    Terry

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,924

    Re: Macro to cut and paste dependent on cell value

    Change the paste portion of the code with PasteSpecial Values and that should solve the issue. I assume (hopefully correctly) that you will know how to make this change.

  5. #5
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Macro to cut and paste dependent on cell value

    Hi there,

    Try this:

    Please Login or Register  to view this content.
    I'm assuming that you want to perform the action on the ActiveSheet

    Hope this helps - please let me know how you get on,

    Regards,

    Greg M

  6. #6
    Forum Contributor
    Join Date
    03-08-2011
    Location
    London
    MS-Off Ver
    Work Office 365 Home 2019
    Posts
    428

    Re: Macro to cut and paste dependent on cell value

    Sorry mate, I thought I knew where to put it, apparently not, can you tell me where it needs to go please

  7. #7
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Macro to cut and paste dependent on cell value

    Hi again,

    Either of the routines posted can be inserted into a standard VBA CodeModule.

    Regards,

    Greg M

  8. #8
    Forum Contributor
    Join Date
    03-08-2011
    Location
    London
    MS-Off Ver
    Work Office 365 Home 2019
    Posts
    428

    Re: Macro to cut and paste dependent on cell value

    Alan and Greg,

    Thank you for your assistance, the finished article is now posted here at the VBA Code for inserting a value according to Zone. I have also accredited your input for which I'm sure the OP will be equally grateful.

    And I've learnt from it too.

    Terry

  9. #9
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Macro to cut and paste dependent on cell value

    Hi again Terry,

    Many thanks for your feedback, for the acknowledgement in the other thread, and also for the Reputation increase

    Glad to hear that things are working correctly now, and pleased to have been able to help.

    Best regards,

    Greg M

+ 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. Auto run macro from paste or paste special in to specific cell
    By Craig Muir in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-27-2014, 10:00 AM
  2. Replies: 4
    Last Post: 04-17-2013, 03:28 PM
  3. Make conditional formatting Macro dependent on cell number format
    By jbyrne in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2010, 10:26 AM
  4. Macro to strikethrough row dependent of cell value in dropdown list
    By Zyphon in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-18-2008, 11:13 AM
  5. [SOLVED] Copy and Paste macro needs to paste to a changing cell reference
    By loulou in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-24-2005, 07:06 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