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:
Sub fixDate() 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 End If For Each cell In Selection cell.Value = vValue Next End Sub
Thanks to rizvisa1 for this tip on the forum.
- How to fill selected cells with given data?
- How to fill selected cells with given data? ✓ - Forum - Excel
- How to take a screenshot of selected cells in excel - How-To - Excel
- Excel vba select cell with specific text - Forum - Excel
- Excel/VBA - Select cells between 2 keywords - How-To - Excel
- Creating pdf from selected cell range ✓ - Forum - Excel