+ Reply to Thread
Results 1 to 5 of 5

Problem setting range in macro based on todays date.

  1. #1
    Registered User
    Join Date
    09-14-2009
    Location
    Nottingham
    MS-Off Ver
    Excel 2003
    Posts
    2

    Problem setting range in macro based on todays date.

    Hi Guys,

    I'm hoping theres a fairly simple solution to this one, I'm pretty new to VB though have used excel for a long time but I can't get my head around how to do this.

    Essentially what I want is a sheet users will use that will have 2 buttons, Emails received and Emails completed. Everytime they receive an email they click a button and a value in a cell on a differant sheet increases by one.

    I have been able to to do this using simple Macros : -
    Please Login or Register  to view this content.
    But my issue is the data range, at present when clicked the value is written to cell C5 and D5. However, what I am after is a VLookup of sorts that will write to the cell based on the date in column B:B. In column B is a list of dates from today onwards, today being in B5, therefore when I press the button I want the data to be written to C5 and then tomorrow D5 etc.

    So over time I would end up with a table like the following: -

    Date Emails R Emails C
    14/09 4 3
    15/9 5 2

    Thanks in advance!

    Edit:
    Title is best I could think of to describe problem!
    Last edited by shakeyjake200; 09-14-2009 at 04:47 PM. Reason: Advised by moderator

  2. #2
    Valued Forum Contributor Shijesh Kumar's Avatar
    Join Date
    05-26-2008
    Location
    Bangalore / India
    MS-Off Ver
    2000
    Posts
    717

    Re: Work Slogger

    Welcome to the forum.
    Please wrap ur code .. see forum rules

  3. #3
    Registered User
    Join Date
    09-14-2009
    Location
    Nottingham
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Work Slogger

    Double post
    Last edited by shakeyjake200; 09-14-2009 at 04:46 PM.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Work Slogger

    You have stumbled into a moderated forum.

    Please take a few minutes to read the forum rules, edit your post to add CODE tags (not QUOTE tags), and amend your thread title to describe your problem.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Problem setting range in macro based on todays date.

    Maybe like this (untested):
    Please Login or Register  to view this content.

+ 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