Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For a UserVal prompt within VBA code, what additional lines of code would I
need to insert so that if I hit the enter key without providing a value, it defaults to a predetermined value? My thanks in advance for help on this matter. Cheers! Brad |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() You could use the on_change event of the workbook to do this: Code: -------------------- Private Sub Worksheet_SelectionChange(ByVal Target As Range) 'if the target contains multiple cells do nothing If Target.Columns.Count 1 Or Target.Rows.Count 1 Then Exit Sub 'If the target is empty on changing it store a standard value If Len(Cells(Target.Row, Target.Column) & "") = 0 Then Cells(Target.Row, Target.Column) = "Standard Value" End If -------------------- It probably needs a bit of tinkering for your needs. but this VBA does the BASIC if you place it in the workbook. Quastions? mail me. -- Dnereb ------------------------------------------------------------------------ Dnereb's Profile: http://www.excelforum.com/member.php...o&userid=26182 View this thread: http://www.excelforum.com/showthread...hreadid=490215 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
res = application.Inputbox("enter value","Value Entry","My Default Value")
-- Regards, Tom Ogilvy "Brad" wrote in message ... For a UserVal prompt within VBA code, what additional lines of code would I need to insert so that if I hit the enter key without providing a value, it defaults to a predetermined value? My thanks in advance for help on this matter. Cheers! Brad |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Default Windows Profile without default Office user info | Excel Discussion (Misc queries) | |||
Default ribbon to open by default when opening xls in browser | Excel Discussion (Misc queries) | |||
Default Set up | Excel Discussion (Misc queries) | |||
default value | Excel Discussion (Misc queries) | |||
IDE default | Excel Discussion (Misc queries) |