+ Reply to Thread
Results 1 to 3 of 3

Copy/Paste Based on Value of Cell

  1. #1
    Registered User
    Join Date
    04-24-2012
    Location
    CA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Copy/Paste Based on Value of Cell

    I'm in need of a macro that will cut and paste contents of a cell based on the value of another cell. More specifically, this macro needs to evaluate each cell in column B for a value of "Item Totals:". Every time it finds the text: "Item Totals:" it should copy the value that is in the cell directly below it, and paste it in column A in the cell offset (-1,1) and each cell below that until it encounters another "Item Totals:" in Column B. Once the cut and paste is done, then it should delete the row that has "Item Totals:" in it and also the row below it that contains the value it is copying to column A. Sounds confusing, I know but hopefully the attached file can help clarify what I'm looking for. Many thanks for all your help!
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Copy/Paste Based on Value of Cell

    Hi,

    You don't necessarily need a macro.

    In A2 copied down
    =IF(OR(LEFT(B2,4)="Item",LEFT(B1,4)="Item"),"",IF(ISTEXT(B1),B1,A1))

    Copy and paste special values in column A.

    Then filter for blanks on column A and delete the rows. Then remove the filter
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    04-24-2012
    Location
    CA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Copy/Paste Based on Value of Cell

    Thank You very much!!! This formula worked perfectly! Saved me lots of hours of cut/paste/delete work! Thanks a million!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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