Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I prompt a user with a dialog box
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Dialog prompt during opening of file | New Users to Excel | |||
save prompt for user exit, but no save prompt for batch import? | Excel Discussion (Misc queries) | |||
Prompt user to select file with default file selected dialog | Excel Programming | |||
Prompt user to select file with default file selected dialog | Excel Programming | |||
Prompt user to select file with default file selected dialog | Excel Programming |