VBA Code to AutoFill a column based on date

fabalshehhi

New Member
Joined
Dec 2, 2020
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
Hi, I have looked around the net, but I can't find a clear answer for the following. also a linked to excel is attached at the bottom



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


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
 
Last edited by a moderator:

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,223,892
Messages
6,175,236
Members
452,621
Latest member
Laura_PinksBTHFT

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