Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
simplify date input
I have the following macro -- it works, but could somone simplify it for me
please? ' Format Column Q for date Range("Q1").Select Selection.NumberFormat = "dd/mm/yyyy" ' input payroll month Range("S1").Select ' Dim Message, Title, Default, Myvalue Message = "Enter Payroll Month date i.e. 05/01/2008 for May 2008" ' Set prompt. Title = "Input Box" ' Set title. Default = "05/01/2008" ' Set default. ' Display message, title, and default value. Myvalue = InputBox(Message, Title, Default) ActiveCell.FormulaR1C1 = Myvalue ' Enter EndOfMonth formular and copy down Range("Q1").Select ActiveCell.FormulaR1C1 = "=EOMONTH(R1C19,0)" Selection.Copy ActiveCell.Offset(0, -2).Range("A1").Select Selection.End(xlDown).Select ActiveCell.Offset(0, 2).Range("A1").Select Range(Selection, Selection.End(xlUp)).Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False ' Column Autofit and delete not-needed Cell Columns("Q:Q").EntireColumn.AutoFit Range("S1").Select Application.CutCopyMode = False Selection.Delete Shift:=xlUp |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How input today's date and keep that date | Excel Worksheet Functions | |||
input a date or update it based on date in another cell | New Users to Excel | |||
date input | Excel Discussion (Misc queries) | |||
input date as date in formula | Excel Programming | |||
input date as date in formula | Excel Programming |