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. Bob Phillips

    Re: Prompt user to select file with default file selected dialog

    Bob Phillips, Sep 14, 2003, in forum: Microsoft Excel Programming
    Replies:
    0
    Views:
    278
    Bob Phillips
    Sep 14, 2003
  2. Bob Phillips

    Re: Prompt user to select file with default file selected dialog

    Bob Phillips, Sep 14, 2003, in forum: Microsoft Excel Programming
    Replies:
    0
    Views:
    276
    Bob Phillips
    Sep 14, 2003
  3. Bruce Cooley

    Re: Prompt user to select file with default file selected dialog

    Bruce Cooley, Sep 15, 2003, in forum: Microsoft Excel Programming
    Replies:
    0
    Views:
    386
    Bruce Cooley
    Sep 15, 2003
  4. Gerry Abbott

    control of dialog macro dialog box. on open

    Gerry Abbott, Jul 22, 2004, in forum: Microsoft Excel Programming
    Replies:
    0
    Views:
    481
    Gerry Abbott
    Jul 22, 2004
  5. 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:
    165
    Gord Dibben
    Aug 27, 2009
Loading...

Share This Page