+ Reply to Thread
Results 1 to 3 of 3

Macro to copy-paste based on changing column references

  1. #1
    Registered User
    Join Date
    03-13-2019
    Location
    New England, USA
    MS-Off Ver
    MS365
    Posts
    10

    Macro to copy-paste based on changing column references

    Hello all,

    I have been a lurking reader for a long time, and have been able to solve many of my excel questions/issues/problems using advice posted on excelforum. I'm hopeful that some members can chime in to help me solve my current problem!

    Scenario: I have a worksheet that utilizes a lot of lookup formulas to sort data in various ways, due to the sheet amount of formulas and data, this workbook operates very slowly. I'm re-writing the workbook to hopefully catalog historical data as hardcoded to reduce the number of indexing formulas active at a given time.

    Problem: I've got a sheet with multiple different tables stacked down the rows (for illustration, table 1 might take up range (C5:P23), table 2 (C28:P37), table 3 (C42:P65), etc. The tables are sorting data for different monthly reporting criteria, but all of the tables in the column range (C:P) are for the month of January, with additional months cataloged horizontally to the right. At the end of January, I would like a macro to copy the various tables and paste (formulas and formatting) into the column ranges (R:AE), row numbers will not change, and then to paste the January tables (columns C:P) as values, and change the font color.

    My problem is that I'm not sure how to make the column references variable. I.e. after February month end, to now copy the February month (columns R:AE) and paste into March columns (AG:AT), and have this process repeat every month by the click of a macro.

    Please let me know if you have any additional questions or if any additional clarification is necessary.
    Thank you in advance!
    Attached Files Attached Files
    Last edited by ForrestGump01; 03-13-2019 at 01:40 PM.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Macro to copy-paste based on changing column references

    Welcome to the Forum (at least as a poster)

    Can you use the headers to identify the columns? Then you could use Find to set a range which will allow you to identify the column in question.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Registered User
    Join Date
    03-13-2019
    Location
    New England, USA
    MS-Off Ver
    MS365
    Posts
    10

    Re: Macro to copy-paste based on changing column references

    Using column headers/find is above my skill level (I'd categorize my macro knowledge level as being below pre-school).

    Maybe you could help me understand the function? Would this macro be searching for the month reference?

    I've made a dummy workbook and attached it to my original question for reference.

    Thanks for the help!

+ 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] Macro to copy paste without changing formulas references?
    By ppgab in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2016, 01:31 PM
  2. [SOLVED] Copy and paste formulas without changing cell references
    By davidx in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-20-2013, 03:34 PM
  3. [SOLVED] Macro to Copy and Paste Value based on cell changing value
    By Taislin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-24-2013, 05:09 PM
  4. Replies: 1
    Last Post: 02-18-2013, 11:36 AM
  5. [SOLVED] Copy / Paste without cell references changing.
    By Big Rick in forum Excel General
    Replies: 6
    Last Post: 05-08-2012, 03:15 PM
  6. Replies: 3
    Last Post: 10-20-2006, 03:33 PM
  7. [SOLVED] Copy/Paste without changing location references
    By Tom in forum Excel General
    Replies: 3
    Last Post: 03-31-2005, 09:06 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