+ Reply to Thread
Results 1 to 2 of 2

Persistant variable from an input box

Hybrid View

  1. #1
    Registered User
    Join Date
    05-16-2019
    Location
    Tampa, Florida
    MS-Off Ver
    MS Office 365
    Posts
    46

    Persistant variable from an input box

    I am using this command to capture the entry from an input box for a filter.

    Range("F:F").AutoFilter Field:=1, Criteria1:="=*" & InputBox("Which Op Center?") & "*"

    My Question is, How can I use this same entry for a filename later in the code?
    Thank you.

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,913

    Re: Persistant variable from an input box

    Something like this.

    myvalue stays available troughout the entire sub.

    myvalue = InputBox("Which Op Center?")
    Range("F:F").AutoFilter Field:=1, Criteria1:="=*" & myvalue & "*"
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 12
    Last Post: 12-30-2017, 10:35 AM
  2. Persistant Menu from Uninstalled Add-In
    By pixeldrdoid in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-08-2017, 03:45 PM
  3. [SOLVED] Zoom to selction-Persistant?
    By exarranum in forum Excel General
    Replies: 7
    Last Post: 04-30-2013, 03:13 AM
  4. Need help with input box variable
    By ybortony in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-22-2012, 03:34 AM
  5. variable in to input data into variable named sheet and if does not exist create
    By rwhidden in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-30-2011, 12:08 AM
  6. Using variable from an input box
    By omarosa in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-01-2009, 12:50 PM
  7. Variable sheets, variable input
    By Beowulfdl in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-24-2009, 11:22 AM

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