Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Assuming "True" And "False" Are actually strings and not the boolean values I think GetData should look more like the following:</p> <pre><code>Sub GetData() Dim LastRow As String Dim rng As Range Dim EmailAddress As String Dim CompanyNumber As String Dim Name As String Dim Comp As String Dim ID As Integer Worksheets("DDregister").Activate Range("K2").Select Lastrow = Worksheets("DDregister").Cells(Rows.Count, "K").End(xlUp).Row For Each rng In Range("K2:K" &amp; LastRow) Select Case rng.value Case "True" EmailAddress = Worksheets("DDregister").Cells(rng.Row,"F").Value CompanyNumber = Worksheets("DDregister").Cells(rng.Row,"B").Value Name = Worksheets("DDregister").Cells(rng.Row,"C").Value Comp = Worksheets("DDregister").Cells(rng.Row,"D").Value ID = Worksheets("DDregister").Cells(rng.Row,"A").Value Call Module3.Check(EmailAddress, CompanyNumber, Name, Comp) Case "False" Case vbNullString ThisWorkbook.Save Application.DisplayAlerts = True 'ThisWorkbook.Close End Select Next rng End Sub </code></pre> <p>Also this is a sub because it does not return anything and why have you put all of these routines in different modules? Since you are passing the values there is no reason to make them global by listing them outside the sub</p> <p>P.S. I did not fix your other SELECT CASE Statement but it has similar issues. SELECT CASE syntax the way you are using it is as follows </p> <pre><code> SELECT CASE [expression] CASE [condition] CASE [condition] CASE ELSE END SELECT </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload