+ Reply to Thread
Results 1 to 3 of 3

VBA to trim indent of a cell

  1. #1
    Registered User
    Join Date
    04-30-2017
    Location
    Pretoria, South Africa
    MS-Off Ver
    2013
    Posts
    54

    VBA to trim indent of a cell

    Hey Guys,

    Whats wrong with my code?

    I am trying to find every cell in the column range that has a left indent " Cevian Capital Partners Ltd" ; first instance in A4.

    Then i want to remove the indent:

    Please Login or Register  to view this content.
    the 2nd tab is what it should look like.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: VBA to trim indent of a cell

    Try:
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: VBA to trim indent of a cell

    Please Login or Register  to view this content.
    Issue is with your If statement. Left() returns string and you are checking if it is numeric.

    Try this.
    Please Login or Register  to view this content.

+ 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. Can you use a hanging indent in an Excel cell?
    By DBTI in forum Excel General
    Replies: 3
    Last Post: 01-21-2020, 12:31 PM
  2. if cell has indent, do x
    By ammartino44 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-24-2015, 02:17 PM
  3. How wrap text in a cell is indent?
    By kent97 in forum Excel General
    Replies: 3
    Last Post: 02-26-2015, 11:03 AM
  4. [SOLVED] Indent in relation to numeric cell value
    By jason.hampton in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-08-2013, 02:46 PM
  5. Indent move cell, 2 indent move 2 cells etc
    By jomuir in forum Excel General
    Replies: 3
    Last Post: 05-14-2012, 11:56 AM
  6. Indent from paste remains after TRIM
    By HuskerBronco in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-24-2006, 09:42 AM
  7. How can I remove an indent within a cell?
    By DB--less than excel expert in forum Excel General
    Replies: 5
    Last Post: 02-17-2006, 04:20 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