+ Reply to Thread
Results 1 to 6 of 6

Leading Zeros being Deleted from Input Box Results

  1. #1
    Registered User
    Join Date
    04-05-2024
    Location
    Washington, USA
    MS-Off Ver
    Office 365
    Posts
    16

    Leading Zeros being Deleted from Input Box Results

    I have a system that will ask the user to change the information used to make a sku if that sku is longer than 14 characters long, but if the input box has a result with leading zeros, they get deleted. Could I get some help as to how to keep those from disappearing?
    Attached Files Attached Files
    Last edited by jonathanramey; 04-10-2024 at 11:27 AM.

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,259

    Re: Leading Zeros being Deleted from Input Box Results

    Get the value of the cell containing the SKU as Text, not Value.

    Artik

  3. #3
    Registered User
    Join Date
    04-05-2024
    Location
    Washington, USA
    MS-Off Ver
    Office 365
    Posts
    16

    Re: Leading Zeros being Deleted from Input Box Results

    Could you give me an example? I am not quite sure I understand. I am wanting to maintain the leading zeros from input box responses.

  4. #4
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,259

    Re: Leading Zeros being Deleted from Input Box Results

    For example, instead of Range("A1").Value, use Range("A1").Text.
    Artik

  5. #5
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,158

    Re: Leading Zeros being Deleted from Input Box Results

    1. Try not to use words in variable names that are the same as the names of methods, properties, functions, commands from vba
    2. You can try with an apostrophe at the beginning of the "Style" => "stle" variable value:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-05-2024
    Location
    Washington, USA
    MS-Off Ver
    Office 365
    Posts
    16

    Re: Leading Zeros being Deleted from Input Box Results

    That worked for me. I was initially hesitant to use the apostrophe because I wasn't sure how it would interact with everything else, but it works just fine. I will also change the variable name as I didn't even know that Style was a name for something else in the program. Thank you!

+ 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] Removing Leading Zeros, maintaining zeros after decimal
    By Waycool86 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-17-2015, 01:15 PM
  2. Leading zeros???
    By daviddc114 in forum Excel General
    Replies: 6
    Last Post: 06-25-2013, 10:58 AM
  3. Leading Zeros
    By collegeofmusic in forum Excel General
    Replies: 6
    Last Post: 01-03-2013, 03:51 PM
  4. leading zeros
    By Fernando Duran in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2006, 03:20 AM
  5. [SOLVED] Add leading zeros
    By Ellen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2006, 08:50 AM
  6. Leading zeros
    By LeePotts in forum Excel General
    Replies: 2
    Last Post: 08-17-2005, 10:05 AM
  7. Replies: 1
    Last Post: 05-04-2005, 02:06 PM

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