Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple code entering data
Hi,
I hope I can get some help on this one. I am looking to do something really simple. I need to track contacts on a daily basis. What I want to have is a list starting at Row 4 column AA. Each row will consist of one colum with the date (ie 2007/03/25) and the second column the number of contacts for that day. I want to have a button that basically increases the contacts by one every time it is clicked. I can create the worksheet and do all I want to do but its the coding that messes me up. :) When the button is clicked it needs to do the following: Find the first empty row starting at R4ColAA. Find the last row with a date entry starting at R4ColAA. If it is todays date then increase ColAB by 1. If it is not todays date then go to next row, add todays date on Col AA and inc col AB by one. Thats it, I know it is a pretty simple code, and any help would be appreciated. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple code entering data
Public Sub CommandButton1_click()
Dim iLastRow As Long iLastRow = Cells(Rows.Count, "AA").End(xlUp).Row If Cells(iLastRow, "AA").Value < Date Then iLastRow = iLastRow + 1 End If Cells(iLastRow, "AA").Value = Date Cells(iLastRow, "AB").Value = Cells(iLastRow, "AB").Value + 1 End Sub -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) wrote in message oups.com... Hi, I hope I can get some help on this one. I am looking to do something really simple. I need to track contacts on a daily basis. What I want to have is a list starting at Row 4 column AA. Each row will consist of one colum with the date (ie 2007/03/25) and the second column the number of contacts for that day. I want to have a button that basically increases the contacts by one every time it is clicked. I can create the worksheet and do all I want to do but its the coding that messes me up. :) When the button is clicked it needs to do the following: Find the first empty row starting at R4ColAA. Find the last row with a date entry starting at R4ColAA. If it is todays date then increase ColAB by 1. If it is not todays date then go to next row, add todays date on Col AA and inc col AB by one. Thats it, I know it is a pretty simple code, and any help would be appreciated. Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple code entering data
Thanks for the quick reply.
Its good, but how do I check if iLastRow has todays date? Thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple code entering data
On Mar 25, 4:10 pm, wrote:
Thanks for the quick reply. Its good, but how do I check if iLastRow has todays date? Thanks Duhhh!!! Just Date to compare... Thanks for all the help, problem has been solved... Cheers. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sometimes entering simple function causes it to occupy two cells, why? | Excel Worksheet Functions | |||
Simple code to append numbers to the existing data in the cells | Excel Programming | |||
Prolblem entering simple Formulae | Excel Discussion (Misc queries) | |||
Code for entering time - trying again | Excel Discussion (Misc queries) | |||
Code for entering time | Excel Discussion (Misc queries) |