+ Reply to Thread
Results 1 to 7 of 7

change a number by 1 value within macro

  1. #1
    Registered User
    Join Date
    12-31-2008
    Location
    haifa, israel
    MS-Off Ver
    Excel 2007
    Posts
    36

    change a number by 1 value within macro

    Hello,

    I'm having a workbook with a lot of formulas to do some calculation and repeated actions.
    every week i need to duplicate the latest spreadsheet and change value in the VLOOKUP formula. for example: i need to change this formula VLOOKUP(A2,WEEK(3)A3:G550,3,1) to this formula: VLOOKUP(A2,WEEK(4)A3:G550,3,1).
    nothing in the formula is changing, beside the week number which increase by 1 each time.

    If i'll find a macro to do so, it will save me a lot of work...

    Thanks

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: change a number by 1 value within macro

    Why not have a template workbook that you paste the data into?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    12-31-2008
    Location
    haifa, israel
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: change a number by 1 value within macro

    This is kind of what i'm doing now, but if i'll have a macro to change the formula, it will save me much time.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: change a number by 1 value within macro

    Using a template with the formulas in shouldn't need a macro to change them

  5. #5
    Registered User
    Join Date
    12-31-2008
    Location
    haifa, israel
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: change a number by 1 value within macro

    OK, i understand that i don't use it this way, probably because i'm not familiar with this...
    I tries to work around with it a little bit, without any success. can you guide me on how to do it?

    Thanks
    Last edited by yrndtn; 11-03-2011 at 08:03 AM.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: change a number by 1 value within macro

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

    See

    http://excel-it.com/excel_templates.htm

  7. #7
    Registered User
    Join Date
    12-31-2008
    Location
    haifa, israel
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: change a number by 1 value within macro

    Attached a sample file.
    in this file there is a sheet for each week that contains some formulas, and a cell (C30) that sum previous week total.
    each week I need to duplicate the last week workbook (it always like that), and change the C30 formula to the previous week. there are more action i'm doing each time, but if i'll work this problem through, i can record macro that will save me a lot of time.

    Thanks
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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