Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How input today's date and keep that date tjsmags Excel Worksheet Functions 3 December 30th 07 10:17 PM
input a date or update it based on date in another cell Doug P New Users to Excel 1 July 18th 07 11:25 PM
date input Paul M. Excel Discussion (Misc queries) 2 April 21st 06 07:14 PM
input date as date in formula Jill Excel Programming 4 June 21st 04 10:36 PM
input date as date in formula horinemj Excel Programming 0 June 9th 04 08:53 PM


All times are GMT +1. The time now is 10:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"