+ Reply to Thread
Results 1 to 6 of 6

Macro to add spaces to beginning of each cell value

  1. #1
    Registered User
    Join Date
    01-15-2014
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2010
    Posts
    5

    Macro to add spaces to beginning of each cell value

    I am in the process of trying to create a macro that will insert two spaces to the beginning of each cell in an entire column. I have created it to successfully select an entire column but I can't seem to get the macro to add the two spaces before the text in the cell. My macro is as follows:
    Please Login or Register  to view this content.
    Any ideas on what is wrong in my code? Thank you.

  2. #2
    Registered User
    Join Date
    01-07-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: Macro to add spaces to beginning of each cell value

    Misread question. This will add it to the first 1000 cells of column A
    Please Login or Register  to view this content.
    Last edited by TankBuilder88; 01-21-2014 at 05:44 PM.

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Macro to add spaces to beginning of each cell value

    Try this:

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Macro to add spaces to beginning of each cell value

    Another option applied on constants:
    Please Login or Register  to view this content.
    or alternatively,
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-14-2013
    Location
    Tilburg, Nederland
    MS-Off Ver
    Excel 2010
    Posts
    256

    Re: Macro to add spaces to beginning of each cell value

    Quote Originally Posted by stnkynts View Post
    Try this:

    Please Login or Register  to view this content.
    If you have numbers in the column and want te change them to text you can also set the format for the cell as text format

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-15-2014
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Macro to add spaces to beginning of each cell value

    Thank you so much. These posts were all very helpful. I greatly appreciate it. Do you know if this macro can be put into a template?

+ 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 Spaces from Beginning & End of a Cell
    By aelingil in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-01-2013, 04:29 PM
  2. [SOLVED] How do I eliminate spaces/characters from the beginning of a cell
    By Biff in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 04:05 AM
  3. [SOLVED] How do I eliminate spaces/characters from the beginning of a cell
    By A Waller in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  4. How do I eliminate spaces/characters from the beginning of a cell
    By A Waller in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  5. How do I eliminate spaces/characters from the beginning of a cell
    By A Waller in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-29-2005, 06:05 PM

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