+ Reply to Thread
Results 1 to 3 of 3

VBA SubString giving unexpected error

Hybrid View

  1. #1
    Registered User
    Join Date
    06-01-2021
    Location
    Florida
    MS-Off Ver
    MS Standard 2019
    Posts
    1

    Question VBA SubString giving unexpected error

    Here is the code:

    fail.PNG

    Everything but the last line is working. Getting a compiler error as invalid qualifier on "temp" on temp.Substring(0, 4). The previous line works and grabs the correct string. I've tried using another string that I manually assigned a value like "hello" and I still get this error.
    Last edited by AlejandroJ; 06-01-2021 at 12:00 PM.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: VBA SubString giving unexpected error


    This codeline is a non sense as the variable is not an object and do you find any 'Substring' statement within the VBA help ?!

  3. #3
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,971

    Re: VBA SubString giving unexpected error

    This is VBA not .Net
    Everyone who confuses correlation and causation ends up dead.

+ 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. [SOLVED] Use of ROUND() Giving Unexpected Results
    By PosseJohn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-13-2015, 07:16 PM
  2. Possible bug? Error in calculation giving unexpected result
    By seanspotatobusiness in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-19-2015, 05:15 AM
  3. Forecast giving unexpected value
    By Tsjallie in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-05-2015, 07:30 AM
  4. Formulas giving unexpected errors
    By Nifty62 in forum Excel General
    Replies: 6
    Last Post: 08-27-2014, 01:00 PM
  5. Formula giving unexpected results
    By johnmerlino in forum Excel General
    Replies: 6
    Last Post: 12-01-2010, 01:20 AM
  6. Autofilter giving unexpected results!
    By Colin Vicary in forum Excel General
    Replies: 3
    Last Post: 09-28-2006, 07:20 AM
  7. [SOLVED] Equation giving unexpected results
    By Mike K in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-27-2005, 11:06 AM

Tags for this Thread

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