VBA Code to AutoFill a column based on date

%3CLINGO-SUB%20id%3D%22lingo-sub-1943354%22%20slang%3D%22en-US%22%3EVBA%20Code%20to%20AutoFill%20a%20column%20based%20on%20date%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1943354%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EHi%2C%20I%20have%20looked%20around%20the%20net%2C%20but%20I%20can't%20find%20a%20clear%20answer%20for%20the%20following.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20would%20like%20a%20VBA%20code%20that%20can%20fill%20up%20the%20cells%2C%20and%20continues%20filling%20not%20start%20from%20the%20begging%20so%20it%20is%26nbsp%3B%20based%20on%20the%20current%20date%20for%20example%20if%20the%20current%20date%20is%2025th%20Nov%20then%20the%20data%20should%20be%20dragged%20till%2024th%20Nov%20and%20from%20the%20next%20day%20it%20should%20only%26nbsp%3B%3C%2FSPAN%3Efill%26nbsp%3B%3CSPAN%3Efor%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E25th%20and%20if%20i%20skipped%203%20days%20it%20should%20fill%20up%20to%20minus%20one%20day%20of%20the%20current%20date%20on.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EIn%20the%20following%20steps%20%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E1-%20from%20Row%204%20untill%20Row%20128%2C%20these%20data%20will%20be%20copied%20till%20one%20day%20before%20the%20current%20date.%20keep%20in%20mind%20in%20adding%20other%20data%20so%20if%20there%20is%20data%20added%20in%20between%20the%20cells%20will%20not%20affect%20the%20VBA%20if%20it%20does%20please%20notify%20in%20the%20comment%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3Eplease%20advice%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E2-%20From%20Row%20129%20untill%20Row%201181%2C%20these%20data%20will%20be%20copied%20and%20changed%20to%20Copy%2FPaste.Values%20-%20also%20you%20will%20notice%20that%20the%20formula%20will%20not%20calculate%20the%20cells%20that%20dont%20have%20a%20Tag%20numbers%20in%20column%20A%20only%20selected%20(example%20is%20cell%20130)%20till%20one%20day%20before%20the%20current%20date.%20keep%20in%20mind%20in%20adding%20other%20data%20so%20if%20there%20is%20data%20added%20in%20between%20the%20cells%20will%20not%20affect%20the%20VBA%20if%20it%20does%20please%20notify%20in%20the%20comment%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1943354%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

Hi, I have looked around the net, but I can't find a clear answer for the following.

 

I would like a VBA code that can fill up the cells, and continues filling not start from the begging so it is  based on the current date for example if the current date is 25th Nov then the data should be dragged till 24th Nov and from the next day it should only fill for 25th and if i skipped 3 days it should fill up to minus one day of the current date on.

In the following steps :

1- from Row 4 untill Row 128, these data will be copied till one day before the current date. keep in mind in adding other data so if there is data added in between the cells will not affect the VBA if it does please notify in the comment

 

please advice 

2- From Row 129 untill Row 1181, these data will be copied and changed to Copy/Paste.Values - also you will notice that the formula will not calculate the cells that dont have a Tag numbers in column A only selected (example is cell 130) till one day before the current date. keep in mind in adding other data so if there is data added in between the cells will not affect the VBA if it does please notify in the comment

0 Replies