Results 1 to 11 of 11

Triiming a Cell

Threaded View

  1. #1
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Triiming a Cell

    Hi all,
    Can you help me with this code, it used to work but now for some strange reason it doesn't.
    What I wanted to do is to trim the values in column I and split it to columns J,K,L and M.

    This is the code I was using:

    Sub Trimming()
    
         'Trim Sold To Code
        
            Dim arr     As Variant
            Dim x       As Variant
            Dim i       As Long
            Dim j       As Long
        
            arr = Range("I2:M" & Cells(Rows.Count, "M").End(xlUp).Row)
            For i = LBound(arr, 1) To UBound(arr, 1)
            x = Split(arr(i, 5), "/")
            For j = LBound(x) To UBound(x)
                arr(i, j + 1) = x(j)
                Next j
            Next i
            Range("I2:M" & Cells(Rows.Count, "M").End(xlUp).Row).Value = arr
         
     End Sub
    I have attached my sample worksheet.
    Thank you very much.

    -Andrew
    Attached Files Attached Files
    Last edited by Andrew.Trevayne; 03-08-2017 at 06:41 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] When one cell equals value of another cell, then third cell displays text of fourth cell?
    By spookymyo in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-12-2021, 02:12 PM
  2. Replies: 2
    Last Post: 12-07-2016, 12:39 PM
  3. [SOLVED] Macro Delete Contents in 23rd corresponding cell if the cell in range is a non-blank cell
    By murtaza.khan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-04-2014, 01:11 AM
  4. If Cell A is equal to Cell B replace the data from Cell A with Cell C. How can I do this.
    By tristanhathaway in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-01-2014, 08:05 PM
  5. Replies: 7
    Last Post: 02-05-2014, 02:20 AM
  6. Replies: 1
    Last Post: 11-06-2013, 02:56 AM
  7. Replies: 1
    Last Post: 11-03-2012, 09: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