View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] aidan.heritage@virgin.net is offline
external usenet poster
 
Posts: 244
Default Macro prompts for a number to be used in this macro as a variable

sub GetANumber
MyNumber=val(inputbox("Please enter a number"))
'HOWEVER, user can type anything they like into an input box
'A UserForm would be a better solution OR a cell on the workbook, as
both
'could be restricted to numeric input only
end sub

Drahos wrote:
Dear All,
could anyone help me to write a part of a macro which will prompt to
input a number. This number will be used in the same macro as a number
variable to specify a condition. I mean a user will be prompted to input the
lowest invoice value. This value can be for example 540.50. This figure
should be used later in the same macro as condition to delete rows having a
smaller value in an appropriate cell. I need a help to write the part of the
macro promting for the input and to assign the input figuer to a variable.
Thank you very much for your help.
Drahos.