+ Reply to Thread
Results 1 to 8 of 8

Macro remove leading spaces

  1. #1
    Forum Contributor
    Join Date
    10-04-2014
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    161

    Macro remove leading spaces

    Looking for a macro that will remove all leading spaces for a sheet.
    Thanks so much in advance!

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Macro remove leading spaces

    That could be very slow.

    This will work for column A

    Please Login or Register  to view this content.
    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Last edited by mehmetcik; 03-29-2018 at 06:01 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Contributor
    Join Date
    10-04-2014
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    161

    Re: Macro remove leading spaces

    understood, my exact range would be J3:W100

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Macro remove leading spaces

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 03-31-2018 at 03:34 PM.

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

    Re: Macro remove leading spaces

    Quote Originally Posted by hftechno View Post
    my exact range would be J3:W100
    try
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    10-04-2014
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    161

    Re: Macro remove leading spaces

    I tried both with no success. Attached is an example as requested. All non-zero values in the shaded area have a leading space.
    Attached Files Attached Files

  7. #7
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro remove leading spaces

    Hi hftechno,
    maybe so
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    10-04-2014
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    161

    Re: Macro remove leading spaces

    That worked!
    Very clean and simple.

+ 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] How to remove leading spaces from a VBA string?
    By jmccoughlin in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-05-2015, 07:56 PM
  2. How to remove leading spaces
    By Terressa in forum Excel General
    Replies: 4
    Last Post: 06-27-2015, 07:45 PM
  3. How to Remove Leading Spaces in excel
    By kisanvikas2015 in forum Excel General
    Replies: 5
    Last Post: 05-21-2015, 09:40 AM
  4. [SOLVED] Remove leading and tariling spaces
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-06-2015, 01:53 PM
  5. Remove Leading Spaces
    By edwardpestian in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-22-2006, 10:34 AM
  6. VBA help please - remove leading spaces
    By Scott Wagner in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-24-2006, 04:20 PM
  7. Remove Leading Spaces
    By Kirk P. in forum Excel General
    Replies: 6
    Last Post: 03-09-2005, 12:10 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