Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro
I recently found the macro listed below. If I wanted the macro to run until
I enter XXX how would I go about that. I would want a line between each date. Option Explicit Private Sub Workbook_Open() Dim vDate As String vDate = InputBox("Please type in a date") Worksheets("Sheet1").Range("A1") = vDate End Sub Thanks in advance |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro
Option Explicit
Private Sub Workbook_Open() Dim vDate As String Dim DestCell As Range Set DestCell = Worksheets("Sheet1").Range("A1") Do vDate = InputBox("Please type in a date") If LCase(vDate) = LCase("xxx") Then Exit Do Else DestCell = vDate Set DestCell = DestCell.Offset(2, 0) End If Loop End Sub Cedric wrote: I recently found the macro listed below. If I wanted the macro to run until I enter XXX how would I go about that. I would want a line between each date. Option Explicit Private Sub Workbook_Open() Dim vDate As String vDate = InputBox("Please type in a date") Worksheets("Sheet1").Range("A1") = vDate End Sub Thanks in advance -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro
The macro would drop dates in column A so fast you would be full before you ever
typed your XXX How about two inputboxes? One for the date and one for the number of dates down column A Private Sub Workbook_Open() Dim rng As Range Dim I As Integer Dim vDate As Date Dim numtimes As Integer With Sheets("Sheet1") vDate = InputBox("Please type in a date") numtimes = InputBox("How far to increment? Enter a number") Set rng = Range("A1") rng.Value = vDate For I = 1 To numtimes Step 1 rng.Offset(I, 0).Value = rng.Offset(I - 1, 0).Value + 1 Next I End With End Sub Gord Dibben MS Excel MVP On Mon, 10 Mar 2008 12:18:00 -0700, Cedric wrote: I recently found the macro listed below. If I wanted the macro to run until I enter XXX how would I go about that. I would want a line between each date. Option Explicit Private Sub Workbook_Open() Dim vDate As String vDate = InputBox("Please type in a date") Worksheets("Sheet1").Range("A1") = vDate End Sub Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
need help to update macro to office 2007 macro enabled workbook | Excel Discussion (Misc queries) | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
using a cell value to control a counter inside a macro and displaying macro value | Excel Worksheet Functions |