Results 1 to 9 of 9

Macro Required to added week numbers to columns

Threaded View

  1. #1
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Macro Required to added week numbers to columns

    Hi,

    Every week I get sent a spreadsheet with the hours booked against specific codes, however, each weeks data is in a separate column (from weeks 1-52).

    What I require is a macro that will check the heading title of each weeks data e.g. WK01, WK02 etc, work out what week it is and input the week number in a new column (Week No) corresponding to that weeks data and also total the time for that week and enter in the Total Hours column

    Please see attached a sample spreadsheet for clarity.

    Please also note that I have asked this question before (http://www.excelforum.com/excel-gene...o-columns.html) and DonkeyOte kindly supplied me with the code to work out the week number i.e.

    =IF(COUNT($D2:$BC2),SUBSTITUTE(LOOKUP(9.99999999999999E+307,$D2:$BC2,$D$1:$BC$1),"Hrs WK",""),0)+0

    however, as the weeks progress I have to manually copy the week number down and add the totals up so I believe a macro would be the best option as I am currently repeating the same task every week.

    The macro needs to:-

    (a) work out the week number and enter in ‘Week No’ column
    (b) macro to copy each weeks data into Total Hours column

    I would be most grateful for any assistance in this matter

    Many thanks in advance


    Regards


    Rob

    N.B. Excel version 2003
    Attached Files Attached Files
    Last edited by robertguy; 02-02-2009 at 03:26 PM.
    Rob

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