+ Reply to Thread
Results 1 to 2 of 2

Removing text after character from inputbox

  1. #1
    Registered User
    Join Date
    11-23-2017
    Location
    Calgary Canada
    MS-Off Ver
    2013
    Posts
    8

    Removing text after character from inputbox

    Hello all,
    I have a small Vba macro, that doesn't seem to work, because I am very new to vba and can't spot the likely simple error, any help would be much appreciated,
    I am looking to enter a character into an input box and a range and then delete all text after and including the character/work in the input box.
    Thanks in advance to anyone who wants to help
    cheers
    Please Login or Register  to view this content.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Removing text after character from inputbox

    Type:=8 is restricting your Inputbox to a range. That is ok for WorkRng which is expected to be a range, but Crit1 should be a string so change it to Type:=2 (only for Crit1 input box).

    Also, you will find you are keeping one character too many. Change the c.Value code to:

    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

+ 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. Removing a certain character from text in cells
    By nav505 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-01-2013, 11:44 AM
  2. [SOLVED] Removing Everything After a Character
    By afriedman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-09-2013, 01:46 AM
  3. Removing text based on a character in a cell
    By Nate L in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-30-2013, 09:35 AM
  4. InputBox-ow to have a user input text in a inputbox
    By noodle48 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2011, 08:17 AM
  5. Removing Everything After Certain Character
    By rykermason in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-08-2010, 02:56 PM
  6. Removing character using Trim..
    By Jocote46 in forum Excel General
    Replies: 5
    Last Post: 05-13-2009, 01:57 PM
  7. Msgbox if Inputbox entry contains character
    By Steph in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-23-2005, 01:05 PM
  8. [SOLVED] removing text after a character
    By Kim in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-18-2005, 10:06 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