Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Aug 2004
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    inputbox property (excel 2002)

    hi. i would like to create an input message box that ask me to input a formula in cell IC11. the formula is like = (any other cell address) like =M11 or A11 so that in cell CI11, the input formula i input will return the result of that input cell. please help. Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: inputbox property (office xp)

    You could use code like this:

    Sub SetFormula()
    Dim varResult As Variant
    varResult = Application.InputBox(Prompt:="Point to a cell or enter a formula", Type:=0)
    If varResult = False Then
    ' User canceled - do nothing
    Else
    ActiveCell.Formula = varResult
    End If
    End Sub

    When you run this procedure, the user can either point to a cell, or type a formula. The resulting formula will be placed in the active cell. You can replace ActiveCell with a reference to a specific cell, for example Range("IC11").

    The code uses the Excel-specific InputBox method of the Application object. Unlike the generic Visual Basic function of the same name, this method allows you to specify what kind of information the user can enter.

  3. #3
    2 Star Lounger
    Join Date
    Aug 2004
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: inputbox property (office xp)

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •