Results 1 to 5 of 5

Problem setting range in macro based on todays date.

Threaded View

  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 : -
    Sub Up_One()
         Range("Data!C5").Value = Range("Data!C5").Value + 1
    End Sub
    Sub Up_Two()
         Range("Data!D5").Value = Range("Data!D5").Value + 1
    End Sub
    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

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