Excel Day(Date) / add number to a cell based off Day(Date)

MrHydrant1857

New Member
Joined
Mar 29, 2019
Messages
35
I have a sheet that i have columns numbered 1-31 (Days of the month). i have another sheet that has a cell with a Today() formula. when i activate the macro i want to get the day of the month from the Today() cell and based off of that day i want to add a number underneath the corresponding day column.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
I have a sheet that i have columns numbered 1-31 (Days of the month). i have another sheet that has a cell with a Today() formula. when i activate the macro i want to get the day of the month from the Today() cell and based off of that day i want to add a number underneath the corresponding day column.
Your description above is not entirely clear to me...

1) What columns are the 1-31 (days of the month) in... Columns A thru Columns AE or somewhere else?

2) What row are the 1-31 (days of the month in... Row 1 or somewhere else?

3) What row does the number you want to add go in... always Row 2 or after the last data item in that column?

4) The number you want to add... what number is it or how do we determine what that number should be?
 
Upvote 0
Rick,

My apologies I am pretty tied up at the moment and just wanted to put something quick out there to see if anyone could help. I do see how my description is not clear. anyways,

1).Yes my Days of the month (1-31) are in column A through AE in row 1 as well.

3)I want to add the number to row 2 below the corresponding day

4) The number will be starting at 0 and each time I click my macro I want to add to that number. basically tallying each time I click the macro on a certain day.
 
Upvote 0
4) The number will be starting at 0 and each time I click my macro I want to add to that number. basically tallying each time I click the macro on a certain day.
I believe this macro will do what you are asking for...
Code:
Sub DailyVisitCounter()
  Cells(2, Day(Now)) = Cells(2, Day(Now)) + 1
End Sub
 
Upvote 0
ok so if the sheet where my Days of the month are (1-31) is named Tally then the code would look something like this?

Sheets("Tally").Cells(2, Day(Now)) = Sheets("Tally").Cells( 2, Day(Now)) + 1
 
Upvote 0
ok so if the sheet where my Days of the month are (1-31) is named Tally then the code would look something like this?

Sheets("Tally").Cells(2, Day(Now)) = Sheets("Tally").Cells( 2, Day(Now)) + 1
Yes



also what if i were to have the days of the month start in column B instead of A?
Sheets("Tally").Cells(2, Day(Now) + 1) = Sheets("Tally").Cells( 2, Day(Now) + 1) + 1[/QUOTE]
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,193
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top