Results 1 to 8 of 8

Creating a User-Defined Range for Formulas

Threaded View

  1. #1
    Registered User
    Join Date
    04-09-2020
    Location
    USA
    MS-Off Ver
    2011
    Posts
    4

    Creating a User-Defined Range for Formulas

    Hey Folks,

    I'm trying to generate an InputBox that allows the user to define the variable that will determine the range for the values spit out by a Macro.

    inputvalue = Application.InputBox(prompt:="Please enter a number.", Title:="Enter a Number", Type:=1)
    If inputvalue = ("1") Then Range = ("f2")
    If inputvalue = ("2") Then Range = ("f2:f3")
    If inputvalue = ("3") Then Range = ("f2:f4")
    If inputvalue = ("4") Then Range = ("f2:f5")
    If inputvalue = ("5") Then Range = ("f2:f6")
    If inputvalue = ("6") Then Range = ("f2:f7")
    If inputvalue = ("7") Then Range = ("f2:f8")
    If inputvalue = ("8") Then Range = ("f2:f9")
    If inputvalue = ("9") Then Range = ("f2:f10")
    End If
         inputvalue= ("0")
    I keep getting an argument not optional error, and I'm unsure as to what it means here. I'm relatively new at this, and could use any help!

    Thanks folks,
    NP
    Last edited by AliGW; 04-11-2020 at 03:41 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] creating user defined functions
    By dr01allen in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-14-2015, 02:53 PM
  2. Creating a User-Defined Function
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-19-2014, 11:10 PM
  3. Copy, paste, replace- user defined range in all the defined sheets
    By aganesan99 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-13-2014, 12:28 PM
  4. Excel 2007 : Creating user defined function
    By cassieyi in forum Excel General
    Replies: 1
    Last Post: 10-02-2011, 04:58 PM
  5. Need help in creating Sheet by using user defined data
    By LampCommandr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2011, 10:58 AM
  6. creating help info for user defined function
    By Joe Carroll in forum Excel General
    Replies: 3
    Last Post: 06-04-2005, 07:05 PM
  7. [SOLVED] How to: User Form to assign a user defined range to a macro variab
    By TrevTrav in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2005, 04:06 PM

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