18 Kasım 2014 Salı

userform validation

' textbox must be filled

If txtAdiSoyadi.Text = "" Then
   MsgBox " name textbox must be filled!!!!!!!!!"
   txtAdiSoyadi.SetFocus
   Exit Sub
 
End If

If txtTcKimlikNo.Text = "" Then
   MsgBox "ID textbox must be filled!!!!!!!!"
   txtTcKimlikNo.SetFocus
   Exit Sub
End If

14 Kasım 2014 Cuma

EXCEL VBA - how many rows data we are going to handle in loop?


Range("a" & Rows.Count).End(xlUp).Row


MsgBox (Range("a" & Rows.Count).End(xlUp).Row)
          ' from bottom to the last filled cell

     
With Cells :
 

MsgBox (Cells(Sheets("Sheet1").Rows.Count, "A").End(xlUp).Row)