+ Reply to Thread
Results 1 to 5 of 5

cut and paste looper that looks at columns for ranges

  1. #1
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    cut and paste looper that looks at columns for ranges

    Hello,

    I have the attached file that has ranges in column DK and DL. I need a macro that will loop through the columns. If there is a value(range) in column DL, cut the range in that cell, and paste it into the range given in column DK adjacent to that cell. If the fields are blank leave the data along and go to the next row until it goes through all of the data on the tab. To reduce size to load I had to paste value the tab so formulas are removed but for the code we do not need that. I can paste the code into the file I need it for. Thanks for any help in advance.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: cut and paste looper that looks at columns for ranges

    In the file the ranges in DK and DL should say 'CY & PY Sales (2)' not 'Data Sample'. I just noticed the different tab name. Hopefully someone will be able to help.

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

    Re: cut and paste looper that looks at columns for ranges

    Does this help?

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: cut and paste looper that looks at columns for ranges

    Thanks. The macro did cut and move the data in DL into DK but that isn't exactly what I meant. In columns DK and DL there is a formula that would tell me what the range of cells is within a data set that needs to be cut and placed somewhere else. For example. Cell DL17 has 'Data Sample'!$Y$16:$AH$16. That is telling me the range that needs to be cut. In cell DK17 there is another range 'Data Sample'!$Y17:$AH$17. That is telling me where the range that was just cut needs to get pasted to. I think the code you show works it just needs to be modified to use the information in the cells as the range in the code to go find and cut and then the next range in the code to go to paste to.

  5. #5
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: cut and paste looper that looks at columns for ranges

    This is the formula used in the DL column to give me the range of data needed to cut.
    =IFERROR(ADDRESS(ROW(A20)-1,$DJ20,,,"CY & PY Sales (2)")&":"&ADDRESS(ROW(A20)-1,VALUE($DJ20+$DH20)),"")
    This is the formula used in the DK column to give me the range the data needs to get pasted to.
    =IFERROR(ADDRESS(ROW(A20),$DJ20,,,"CY & PY Sales (2)")&":"&ADDRESS(ROW(A20),VALUE($DJ20+$DH20)),"")

    Any ideas?

+ 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. [SOLVED] looper to copy tabs of a data file into template and save as
    By amartin575 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-26-2014, 10:47 AM
  2. Paste multiple ranges by Inputbox and paste it on one slide in powerpoint
    By irfanparbatani in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2012, 10:32 PM
  3. Replies: 5
    Last Post: 11-15-2010, 10:56 PM
  4. [SOLVED] Looper blooper
    By Arne Hegefors in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2006, 10:25 AM
  5. [SOLVED] Looper Blooper
    By stendahl_jones in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-20-2006, 07:40 AM

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