Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

284
Vistas
How can I have excel go down a list and check for certain conditions?

This is code the internet and I came up with. Please could you tell me what I’m doing wrong? I keep getting an error that says “can’t use a loop without a do”

Sub additions ()

Range(“BI1”)  = “Comments”

Range(“V2”).Select

Do until IsEmpty(ActiveCell)


If (Range(ActiveCell) = “DM”) Then 
ActiveCell.Offset(0,39).Select
Range(ActiveCell) = “Developed Markets”
ActiveCell.Offset(1,-39).Select
End If

Loop

End Sub
about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Add String to One Column If Another String in Another Column

Option Explicit

Sub Additions()
    
    Dim ws As Worksheet: Set ws = ActiveSheet ' improve!
    
    Dim srg As Range
    Set srg = ws.Range("V2", ws.Cells(ws.Rows.Count, "V").End(xlUp))
    
    Dim drg As Range: Set drg = srg.EntireRow.Columns("BI")
    ws.Range("BI1").Value = "Comments"
    
    Dim sCell As Range
    Dim r As Long
    
    For Each sCell In srg.Cells
        r = r + 1
        If CStr(sCell.Value) = "DM" Then ' is a match
            drg.Cells(r).Value = "Developed Markets"
        'Else ' is not a match; do nothing
        End If
    Next sCell
 
    MsgBox "Additions finished.", vbInformation
    
End Sub
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda