title: Condition for Empty String in VBA
body: <p>how do I check if the string variable is empty in vba?</p>
  
  <p>if:</p>
  
  <pre><code>Dim StrFile1 As String, StrFile2 As String
  Dim Text3 As String
  Dim Len1 as Integer, Len2 As Integer 
  
    With NewMail
     Text3 = Cells(i, 3).Value
     StrPath = Cells(i, 2).Value &amp; Text3
     Text = Cells(i, 1).Value
  
    .Subject = 
    ' adds the data in column3 with space as subject
    .From = 
    .To = Text
    .BCC = ""
    .TextBody = 
  
  StrFile1 = Dir(StrPath &amp; "*.txt")
     Len1 = Len(StrFile1)
     Do While Len(StrFile1) &gt; 0
     .AddAttachment StrPath &amp; StrFile1
     StrFile1 = Dir
     Loop
  
     StrFile2 = Dir(StrPath &amp; "*.pdf")
     Len2 = Len(StrFile2)
     Do While Len(StrFile2) &gt; 0
     .AddAttachment StrPath &amp; StrFile2
     StrFile2 = Dir
     Loop
  
     If (Len1 &amp; Len2) = 0 Then
     GoTo Last
  
  
  
    '.AddAttachment Text3
    .Send
  End With
  i = i + 1
  Loop
  
  Last:
  End With
  i = i + 1
  Loop
  </code></pre>
  
  <p><strong>Now i want to check simultaneously if Len1 and Len2 are 0, if so then I want to go to Last.</strong></p>
  
  <p>When I use this code I get a message/Compile error "<strong>Want to end with without with"</strong>
  and
  i am not sure if </p>
  
  <pre><code>If (Len1 &amp; Len2) = 0 Then
         GoTo Last
  </code></pre>
  
  <p>this is a proper code.
  and <strong>Do i need to declare the label Last??</strong></p>