Results 1 to 5 of 5

next without For

Threaded View

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

    next without For

    Hi

    I am trying to create a VBA to clear a list with specific works.
    I am having this issue:
    Next without For.

    Anybody could help me.
    Thanks

    Sub Macro1()
    '
    ' Macro1 Macro
    '
    
    '
    Dim a As Integer
    
    
    'keyword.
    Sheets("List Material to Deleted").Select
    
        For a = 1 To 100
        
        Text = Cells(a, 1)
        If Text = "" Then Exit Sub
     
        Cells(a, 2).FormulaR1C1 = "=LEN(RC[-1])"
    
        LONGITUD = Cells(a, 2).FormulaR1C1 = "=LEN(RC[-1])"
    
    'search to delete.
    
            Sheets("ML").Select
    Dim b As Integer
    
            For b = 1 To 300
        
            text2 = Cells(b, 1)
            If text2 = "" Then Exit Sub Else
            
            
            
        If (Left(Cells(b, 1), LONGITUD) = Text) Then
        
     Cells(b, 1).ClearContents
             
          
    Next b
    
    
    
     End If
     
    
    
    Sheets("List Material to Deleted").Select
    
    Next a
    
    End Sub
    Attached Files Attached Files
    Last edited by Pepe Le Mokko; 10-24-2019 at 11:22 AM.

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