+ Reply to Thread
Results 1 to 2 of 2

Len Cells not working

  1. #1
    Registered User
    Join Date
    10-24-2019
    Location
    montreal
    MS-Off Ver
    2013
    Posts
    3

    Len Cells not working

    Hi Guys,
    I made this macro but is not working properly
    I want if in cell (x,x) the number of characters is lower than 7 and cell (y,y) have the leather T
    Then copy cell (z,z)...
    This is the code I wrote:

    Dim x As Integer

    Dim nRows As Integer

    nRows = Cells(Rows.Count, 1).End(xlUp).Row

    For x = 6 To nRows

    If Cells(x, 11) <> 0 And Cells(x, 10) <> 0 Then

    If (Len(Cells(x, 11)) <= 7 And Cells(x, 10) = "T") Then


    Else

    Cells(x, 11).Copy

    Cells(x, 24).Select

    ActiveSheet.Paste




    End If

    End If


    Next x

    End Sub

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: Len Cells not working

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

+ 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] Protection for selected cells not working it protects all cells
    By sunshine1325 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-10-2019, 07:20 AM
  2. Replies: 3
    Last Post: 07-16-2014, 03:24 PM
  3. Correct/Working (Index,Match) formula not working between cells
    By barnerd in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 02-11-2014, 01:20 PM
  4. Selecting all cells. Cells.Select is not working
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-19-2013, 04:50 PM
  5. Replies: 7
    Last Post: 08-16-2010, 05:40 AM
  6. Replies: 9
    Last Post: 07-07-2008, 10:34 AM
  7. Replies: 1
    Last Post: 02-11-2006, 01:00 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