I often need to fill cells with a date of production.
What kind of a macro would be useful in this situation so that I could just select the cells that I need to fill and just enter the date of productions?
Here is a macro. Give it a shot, but make sure that you have a backup before hand. Select the target cells first and run the macro
If you press cancel, it would wipe out all the data of selection. Not a good idea.
Use this. It will confirm before wiping out:
Dim vValue As Variant
'default date is yesterday
vValue = InputBox("Enter Date", "Date", Date - 1)
If (vValue = "") Then
confirm = MsgBox("Do you wish to wipe out data from selection ?", vbQuestion + vbYesNo)
If confirm <> vbYes Then Exit Sub
For Each cell In Selection
cell.Value = vValue
Thanks to rizvisa1
for this tip on the forum.
Published by aakai1056
Latest update on February 27, 2010 at 04:02 AM by aakai1056.