i have an example file see enclosed.
In this file i have two dates. Start and End. I want to use VBA to fill a column from the start date to the end date (with each entry being the first of the month).
Not sure the best way to do this.
i have an example file see enclosed.
In this file i have two dates. Start and End. I want to use VBA to fill a column from the start date to the end date (with each entry being the first of the month).
Not sure the best way to do this.
Did you read 'autofill' in the VBEditor's help ?
I am not sure i understand?
Based on snb's comment i guess they are suggesting i use auofill technique to solve this problem.
So proceeding along this path i came up the following:
![]()
Please Login or Register to view this content.
seems to work..................
Worked in my test file..........but when i run it in my main program i get this
08/01/07
09/01/07
08/02/07
09/02/07
08/03/07
09/03/07
08/04/07
09/04/07
08/05/07
09/05/07
08/06/07
09/06/07
08/07/07
09/07/07
08/08/07
very strange..........any ideas?
ok figured it out. By accident.
So in my code i pasted values for G2 and G3.
G3 was actually formatted in a date format of say "9/1/07"
While the G2 data when it got pasted was in the format of "39295"
so you had something like this
39295
9/1/07
when you paste this down you get
39295
9/1/07
39296
9/2/07
39297
9/3/07
which is
8/1/07
9/1/07
8/2/07
9/2/07
8/3/07
9/3/07
so to fix it i just made sure both the values i put into thte cell were dates like this
8/1/07
9/1/07
when you autofill down this you get the right result.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks