+ Reply to Thread
Results 1 to 2 of 2

input box value into formula written with VBA

Hybrid View

  1. #1
    Registered User
    Join Date
    06-08-2009
    Location
    Woodbridge, VA
    MS-Off Ver
    Excel 2007
    Posts
    4

    input box value into formula written with VBA

    How can I use input box values in a formula that is put into a cell with VBA?


    Example:
    
    Sub comment_count()
    Dim NUM1 As Variant
    Dim NUM2 As Variant
    NUM1 = InputBox("Enter the low range of comment numbers.", "ENTER")
    NUM2 = InputBox("Enter the high range of coment numbers.", "ENTER")
    
    Application.Worksheets("Install").Range("E17").FormulaArray = "=SUMPRODUCT(--ISNUMBER(MATCH(""*""&ROW(INDIRECT(""& NUM1:NUM2 &""))&""*"",$E$18:$E$2500&"""",0)))"
    
    End Sub
    Last edited by jcgroove; 06-09-2009 at 08:58 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: input box value into formula written with VBA

    Please take a few minutes to read the forum rules, and then edit your post to add code tags.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1