enter date in cell

vasu12

New Member
Joined
Feb 6, 2017
Messages
12
Sub date_for_month()

Dim startdate as date
Dim enddate as date

Startdate =#01 Feb 2017 #
Enddate =#01 Mar 3017#

Do while startdate < enddate
Activecell = startdate
Startdate = startdate + 1
Activecell.offset(0,1), range ("A1").select
Loop
End sub

Still need some fine tunes
1. Date enter in excel cell (I don't want to edit every time in program)
2.only one month will given as input, next month should take automatically.. ( I'm thinking as Date =[(year),(Month+1),(day) ] function
Will it work
3. How to make run another workbook macro from active(master ) workbook
 
Last edited:

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Activecell.offset(0,1), range ("A1").select
Why is the highlighted text needed in the above code ? I think the offset will take it from the current cell to one column right. I just removed it and it worked fine.
Secondly, when you give the end date, the excel will automatically keep changing the months until it reaches the end date.
 
Upvote 0
if its only every run in the month of need you could get that from the system clock, and have it identify the first of the month and the last day of the month
 
Upvote 0
Thanks for kind advice.
My problem is I don't want to edit every time in program to change date. Give me some idea to do in sheets cell itself. what I'm asking is entered in a cell and program should take that date and run..
 
Last edited:
Upvote 0
Thanks for your kind advice.
No, I have to take print out before next month starts. So I can't use system clock
 
Upvote 0
ok, so how about you have a sheet set aside for the start date you want and we build from that
 
Upvote 0
Thanks for your kind advice.
Separate sheet idea is good. But no other way to make this work
 
Upvote 0

Forum statistics

Threads
1,214,535
Messages
6,120,090
Members
448,944
Latest member
sharmarick

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