View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
colofnature[_47_] colofnature[_47_] is offline
external usenet poster
 
Posts: 1
Default Please help a newbie to VB!!!


Try:

[a1] = Application.InputBox("Enter a value")

This will accept any value from an inputbox and place it in A1. To
force the inputbox to only accept a number:

[a1] = Application.InputBox("Enter a value", , , , , , , 1)

this will display an error message and return FALSE if the value isn't
a number.

The first example will display a valid date in the standard format, but
will also accept text values. The second will accept dates but convert
them into numbers (e.g. 06/06/2006 will be displayed as 38874, so you'd
have to tell your macro to format it accordingly)

Hope this helps
Col


--
colofnature
------------------------------------------------------------------------
colofnature's Profile: http://www.excelforum.com/member.php...o&userid=34356
View this thread: http://www.excelforum.com/showthread...hreadid=548915