Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

216
Views
Presents Do Without Loop Error (very rusty)

I've generated quite a large code that works to transform payroll data into a new system but am struggling with my final two codes prior to including them... This being one of them. This one presents a 'Do without Loop' error. The return text values are in there as I still need to workout how to return another column effectively (I assume adding a result range might assist with this? but one step at a time). Any help/guidance would be amazing! :)

    Sub Ceiling_Test()

    Dim Ref_Ceiling_Row As String
    Dim Ref_Ceiling_Col As String
    Dim Ceiling As String
    Dim Ref_Role_Row As String
    Dim Ref_Role_Col As String
    Dim Role As String
    Dim Counter_Ceiling As Long
    
    'Locate Ref Ceiling
    Ref_Ceiling_Row = Sheets(1).Range("F2").Row
    Ref_Ceiling_Col = Sheets(1).Range("F2").Column
    'Loop
    Do
        If Cells(Ref_Ceiling_Row + Counter_Ceiling + 1, Ref_Ceiling_Col) = "" Then Exit Do
        Ceiling = Cells(Ref_Ceiling_Row + Counter_Ceiling + 1, Ref_Ceiling_Col)
        If Ceiling = "General Manager" Then
            Cells(Ref_Ceiling_Row + Counter_Ceiling + 1, Ref_Ceiling_Col + 30) = "external_uuid:WAV"
            
        ElseIf Ceiling = "Director" Then
            Cells(Ref_Ceiling_Row + Counter_Ceiling + 1, Ref_Ceiling_Col + 5) = "Return corresponding value in AG"
            
        ElseIf Ceiling = "Executive Manager" Then
            Cells(Ref_Ceiling_Row + Counter_Ceiling + 1, Ref_Ceiling_Col + 5) = "Return corresponding value in AF"
    End If
        Counter_Ceiling = Counter_Ceiling + 1
    Loop
    
    'Locate Ref Role
    Ref_Role_Row = Sheets(1).Range("H2").Row
    Ref_Role_Col = Sheets(1).Range("H2").Column
    'Loop
    Do
        If Cells(Ref_Role_Row + Counter_Ceiling + 1, Ref_Role_Col) = "" Then Exit Do
        Role = Cells(Ref_Role_Row + Counter_Ceiling + 1, Ref_Role_Col)
        If Role = "Manager" Or Role = "Employee" Then
            Cells(Ref_Role_Row + Counter_Ceiling + 1, Ref_Role_Col + 28) = "Home Org Value in O"
        End If
        Counter_Ceiling = Counter_Ceiling + 1
    Loop
    
End Sub
about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!