+ Reply to Thread
Results 1 to 4 of 4

VBA Macros to Trim

  1. #1
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    909

    VBA Macros to Trim

    Hello Again,

    I am looking for a VBA Macros to trim only first row (Header) i.e. Range("1:1") but uptill last available data column.

    Any help on this problem.

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: VBA Macros to Trim

    Hey!!

    Use this code -

    Please Login or Register  to view this content.
    Thank You,

    Deep
    Cheers!
    Deep Dave

  3. #3
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    909

    Re: VBA Macros to Trim

    Thanks for your code topic marked as solved and reputation is added.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,445

    Re: VBA Macros to Trim

    Hey Deep!!

    The "Dim LC as Byte" scares me a little.

    Byte can go from 0 to 255. If the OP had more columns that 255 your code would break!!

    In Excel 2003 the max columns was 256 - see http://office.microsoft.com/en-us/ex...005199291.aspx
    But in 2007 they increased it.. See: http://office.microsoft.com/en-us/ex...010073849.aspx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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