+ Reply to Thread
Results 1 to 4 of 4

Update Macro with many cell references

  1. #1
    Forum Contributor
    Join Date
    02-16-2012
    Location
    London, England
    MS-Off Ver
    Excel mac 2011
    Posts
    238

    Update Macro with many cell references

    Hi there,

    I have a small program here that makes quite a nice simple calendar for just the one month. I have already modified it so that it automatically makes a new sheet for it in the event that someone clicks the button and over writes some valuable work, but I now want to add to it so that I can have two months on there.

    The easy way would be to put in an if statement and just copy the whole code again inside the if statement with updated cell references, but it is clumsy. Is there a way to offset every cell reference in the macro by say 8 columns? The referencing of cells is "A1" type of referencing.

    What would be the best way to go about this without completely rewriting the code?

    Kind regards
    Rob

  2. #2
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    453

    Re: Update Macro with many cell references

    Use a variable: X
    loop the code twice
    first run make X=0
    second run make X=8

    references replace
    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.
    Barriers are there for those who don't want to dream

  3. #3
    Forum Contributor
    Join Date
    02-16-2012
    Location
    London, England
    MS-Off Ver
    Excel mac 2011
    Posts
    238

    Re: Update Macro with many cell references

    Perfect, I hadn't thought of doing that, thank you.

  4. #4
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    453

    Re: Update Macro with many cell references

    You are welcome,
    Come back if you have any problem
    Vicho

+ 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. How to automatically update cell references
    By underrated209 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-20-2013, 10:12 PM
  2. Macro cell references
    By philcrump in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-15-2009, 04:44 PM
  3. Cell References sometimes don't update!
    By jimfx in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-07-2007, 09:57 AM
  4. Need to update cell references to separate workbook
    By Irish Rob in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2006, 06:09 PM
  5. [SOLVED] Problem with cell references in my macro
    By Still Learning in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-07-2006, 09:00 PM
  6. Macro without cell references......
    By Winnie_Shrub in forum Excel General
    Replies: 1
    Last Post: 06-28-2006, 04:15 AM
  7. Adding a row to worksheet does not update cell references in another.
    By blausen in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-25-2006, 05:20 PM

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