How do I prompt a user with a dialog box

Discussion in 'Microsoft Excel Programming' started by Guest, Nov 22, 2005.

  1. Guest

    Guest Guest

    I am new to programing in Excel and would like to creat a front end dialog
    that prompts the user for a date. Then returning information be in a text
    field so they can copy it and paste into their apps.

    Is this even possible?

    Here is a macro I made the extract the info and filters it. It is all hard
    coded.

    Sub DOOR_COUNTS()
    '
    ' DOOR_COUNTS Macro
    ' Macro recorded by m.hartman
    '

    '
    Workbooks.OpenText Filename:="\\Softail\doorcount\Count\Main.txt",
    Origin:= _
    437, StartRow:=1, DataType:=xlDelimited,
    TextQualifier:=xlDoubleQuote, _
    ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False,
    Comma:=False _
    , Space:=False, Other:=True, OtherChar:="|",
    FieldInfo:=Array(Array(1, 1 _
    ), Array(2, 1), Array(3, 2), Array(4, 1), Array(5, 2), Array(6, 1),
    Array(7, 2), Array(8, 1), _
    Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13,
    1)), _
    TrailingMinusNumbers:=True
    Columns("A:B").Select
    Selection.Delete Shift:=xlToLeft
    Columns("A:A").Select
    Selection.Delete Shift:=xlToLeft
    Columns("C:C").Select
    Selection.Delete Shift:=xlToLeft
    Columns("D:E").Select
    Selection.Delete Shift:=xlToLeft
    Columns("F:F").Select
    Selection.Delete Shift:=xlToLeft
    Columns("C:C").ColumnWidth = 18.57
    Columns("B:B").Select
    Selection.ColumnWidth = 13.71
    Selection.ColumnWidth = 16
    Columns("A:E").Select
    With Selection
    .HorizontalAlignment = xlCenter
    .VerticalAlignment = xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = False
    End With
    Rows("1:1").Select
    Selection.Insert Shift:=xlDown
    Range("A1").Select
    ActiveCell.FormulaR1C1 = "DOOR ID"
    Range("B1").Select
    ActiveCell.FormulaR1C1 = "DESCRIPTION"
    Range("C1").Select
    ActiveCell.FormulaR1C1 = "DATE"
    Range("D1").Select
    ActiveCell.FormulaR1C1 = "IN"
    Range("E1").Select
    ActiveCell.FormulaR1C1 = "OUT"
    Range("A1:E1").Select
    With Selection.Interior
    .ColorIndex = 56
    .Pattern = xlSolid
    End With
    Selection.Font.ColorIndex = 2
    Selection.Font.Bold = True
    Range("E1").Select
    Selection.AutoFilter
    Selection.AutoFilter Field:=3, Criteria1:="11/21/2005 22:00:00"

    Workbooks.OpenText Filename:="\\Softail\doorcount\Count\Buell.txt",
    Origin:= _
    437, StartRow:=1, DataType:=xlDelimited,
    TextQualifier:=xlDoubleQuote, _
    ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False,
    Comma:=False _
    , Space:=False, Other:=True, OtherChar:="|",
    FieldInfo:=Array(Array(1, 1 _
    ), Array(2, 1), Array(3, 2), Array(4, 1), Array(5, 2), Array(6, 1),
    Array(7, 2), Array(8, 1), _
    Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13,
    1)), _
    TrailingMinusNumbers:=True
    Columns("A:B").Select
    Selection.Delete Shift:=xlToLeft
    Columns("A:A").Select
    Selection.Delete Shift:=xlToLeft
    Columns("C:C").Select
    Selection.Delete Shift:=xlToLeft
    Columns("D:E").Select
    Selection.Delete Shift:=xlToLeft
    Columns("F:F").Select
    Selection.Delete Shift:=xlToLeft
    Columns("C:C").ColumnWidth = 18.57
    Columns("B:B").Select
    Selection.ColumnWidth = 13.71
    Selection.ColumnWidth = 16
    Columns("A:E").Select
    With Selection
    .HorizontalAlignment = xlCenter
    .VerticalAlignment = xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = False
    End With
    Rows("1:1").Select
    Selection.Insert Shift:=xlDown
    Range("A1").Select
    ActiveCell.FormulaR1C1 = "DOOR ID"
    Range("B1").Select
    ActiveCell.FormulaR1C1 = "DESCRIPTION"
    Range("C1").Select
    ActiveCell.FormulaR1C1 = "DATE"
    Range("D1").Select
    ActiveCell.FormulaR1C1 = "IN"
    Range("E1").Select
    ActiveCell.FormulaR1C1 = "OUT"
    Range("A1:E1").Select
    With Selection.Interior
    .ColorIndex = 56
    .Pattern = xlSolid
    End With
    Selection.Font.ColorIndex = 2
    Selection.Font.Bold = True
    Range("E1").Select
    Selection.AutoFilter
    Selection.AutoFilter Field:=3, Criteria1:="11/21/2005 22:00:00"

    Workbooks.OpenText
    Filename:="\\Softail\doorcount\Count\Service.txt", Origin:= _
    437, StartRow:=1, DataType:=xlDelimited,
    TextQualifier:=xlDoubleQuote, _
    ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False,
    Comma:=False _
    , Space:=False, Other:=True, OtherChar:="|",
    FieldInfo:=Array(Array(1, 1 _
    ), Array(2, 1), Array(3, 2), Array(4, 1), Array(5, 2), Array(6, 1),
    Array(7, 2), Array(8, 1), _
    Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13,
    1)), _
    TrailingMinusNumbers:=True
    Columns("A:B").Select
    Selection.Delete Shift:=xlToLeft
    Columns("A:A").Select
    Selection.Delete Shift:=xlToLeft
    Columns("C:C").Select
    Selection.Delete Shift:=xlToLeft
    Columns("D:E").Select
    Selection.Delete Shift:=xlToLeft
    Columns("F:F").Select
    Selection.Delete Shift:=xlToLeft
    Columns("C:C").ColumnWidth = 18.57
    Columns("B:B").Select
    Selection.ColumnWidth = 13.71
    Selection.ColumnWidth = 16
    Columns("A:E").Select
    With Selection
    .HorizontalAlignment = xlCenter
    .VerticalAlignment = xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = False
    End With
    Rows("1:1").Select
    Selection.Insert Shift:=xlDown
    Range("A1").Select
    ActiveCell.FormulaR1C1 = "DOOR ID"
    Range("B1").Select
    ActiveCell.FormulaR1C1 = "DESCRIPTION"
    Range("C1").Select
    ActiveCell.FormulaR1C1 = "DATE"
    Range("D1").Select
    ActiveCell.FormulaR1C1 = "IN"
    Range("E1").Select
    ActiveCell.FormulaR1C1 = "OUT"
    Range("A1:E1").Select
    With Selection.Interior
    .ColorIndex = 56
    .Pattern = xlSolid
    End With
    Selection.Font.ColorIndex = 2
    Selection.Font.Bold = True
    Range("E1").Select
    Selection.AutoFilter
    Selection.AutoFilter Field:=3, Criteria1:="11/21/2005 22:00:00"
    End Sub
     
    Guest, Nov 22, 2005
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tjb

    msgbox prompt when user selects data from combo box

    tjb, Jul 11, 2003, in forum: Microsoft Excel Programming
    Replies:
    6
    Views:
    835
  2. Gerry Abbott

    control of dialog macro dialog box. on open

    Gerry Abbott, Jul 22, 2004, in forum: Microsoft Excel Programming
    Replies:
    0
    Views:
    596
    Gerry Abbott
    Jul 22, 2004
  3. Guest

    how do i create a pop up box to prompt the user for info?

    Guest, Mar 5, 2005, in forum: Microsoft Excel Programming
    Replies:
    7
    Views:
    343
    Tom Ogilvy
    Mar 5, 2005
  4. Save As Dialog does not prompt for Web File Properties

    , Nov 7, 2005, in forum: Microsoft Excel Programming
    Replies:
    1
    Views:
    551
    Guest
    Nov 7, 2005
  5. Tom Ogilvy

    Re: Prompt user to select a printer using a checkbox within a user

    Tom Ogilvy, Jan 10, 2007, in forum: Microsoft Excel Programming
    Replies:
    0
    Views:
    543
    Tom Ogilvy
    Jan 10, 2007
  6. User Form Text Box - auto delete prompt text

    , Jul 31, 2008, in forum: Microsoft Excel Programming
    Replies:
    2
    Views:
    659
    Susan
    Jul 31, 2008
  7. 'Cancel' on User Prompt Box

    , May 12, 2009, in forum: Microsoft Excel Programming
    Replies:
    2
    Views:
    178
  8. bert_lady

    Prompt for tab name and then prompt for number of iterations of ta

    bert_lady, Aug 27, 2009, in forum: Microsoft Excel Programming
    Replies:
    2
    Views:
    203
    Gord Dibben
    Aug 27, 2009
Loading...