+ Reply to Thread
Results 1 to 3 of 3

Vba adds unwanted space

  1. #1
    Registered User
    Join Date
    06-12-2021
    Location
    Sweden
    MS-Off Ver
    2016
    Posts
    1

    Question Vba adds unwanted space

    Hello!

    Im new to VBA and I would be really grateful if anyone could solve my issue.

    The other day I wrote this code:

    Please Login or Register  to view this content.
    It worked perfectly, I saved it and closed. Today I opened it up and the code suddenly stopped working.
    The only difference I could see was that VBA automatically added a space in the end between Range(Here)("A1"), so it looke like this

    Please Login or Register  to view this content.

    And I cant remove the space, could any kind soul tell me why excel suddenly added a space and how I can fix it?
    Last edited by 6StringJazzer; 06-12-2021 at 09:09 PM. Reason: PLEASE USE CODE TAGS

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Vba adds unwanted space

    The line of code causes a runtime error and probably isn't what you actually want to do. What cell are you trying to reference with that line of code?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Vba adds unwanted space

    Quote Originally Posted by reparsa View Post
    Please Login or Register  to view this content.
    It worked perfectly
    I can hardly believe it worked.
    Sheet object doesn't have End property.
    It should be something like
    Please Login or Register  to view this content.
    or in one line
    Please Login or Register  to view this content.

    .Range("A1") in red and bold is not needed.

+ 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] sending attachment with Excel VBA adds %20 on filename instead of a space
    By Marijke in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-25-2022, 11:46 AM
  2. [SOLVED] Unwanted extra space
    By makinmomb in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-28-2014, 12:53 PM
  3. Dash or Hyphen Automatically Adds Space in VBA code
    By noodle88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-13-2014, 11:46 PM
  4. Copying into merged cells adds unwanted tabs
    By net2chris in forum Excel General
    Replies: 5
    Last Post: 08-15-2013, 08:07 PM
  5. Replies: 6
    Last Post: 06-21-2012, 12:32 PM
  6. unwanted space
    By Genkster in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-02-2007, 11:34 AM
  7. unwanted line space - how do I clear it??
    By Ian Parry in forum Excel General
    Replies: 3
    Last Post: 01-11-2007, 08:31 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