Jump to content
Fórum Script Brasil
  • 0

Como executar um Loop que percorra todas as linhas de uma coluna sem travar


Question

Como executar um Loop que percorra todas as linhas de uma coluna sem travar, exemplo


Sub MacroDB()

Application.ScreenUpdating = False

teste = 1

Coluna =1

ValorS = Range("I4")


Do While teste <> 1

Range("I4").Select
Selection.Copy


    If Cells(1, Coluna) = "" Then
    
    Cells(1, Coluna).Select
    
        ElseIf Cells(2, Coluna) = "" Then
        
        Cells(2, Coluna).Select
    
            Else
            
            Cells(1, Coluna).End(xlDown).Offset(1, 0).Select

    End If


Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
        

loop

 

Edited by Gabriel Prado
Link to post
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Cloud Computing


  • Forum Statistics

    • Total Topics
      148679
    • Total Posts
      644499
×
×
  • Create New...