Guest User

Untitled

a guest
Feb 12th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub cmdEnd_Click()
  2.     Dim startIndex As Integer 'Zähler für die jeweilige Reihe
  3.    Dim ws As Worksheet
  4.     Dim currentNr As String
  5.     Dim i As Integer
  6.     startIndex = 2
  7.     currentNr = ActiveSheet.Cells(startIndex, 1).Value
  8.    
  9.    
  10.     For i = startIndex To 100
  11.         If (currentNr = "") Then
  12.         ActiveSheet.Cells(startIndex, 1).Value = startIndex - 1
  13.         ActiveSheet.Cells(startIndex, 2).Value = DTPicker1.Value
  14.         ActiveSheet.Cells(startIndex, 3).Value = TextBox2.Value
  15.         ActiveSheet.Cells(startIndex, 5).Value = TextBox3.Value
  16.         ActiveSheet.Cells(startIndex, 6).Value = TextBox4.Value
  17.         ActiveSheet.Cells(startIndex, 8).Value = ComboBox1.Value
  18.         ActiveSheet.Cells(startIndex, 9).Value = TextBox5.Value
  19.         If (OptionButton1.Value = True) Then
  20.         ActiveSheet.Cells(startIndex, 7).Value = "J"
  21.         Else
  22.         ActiveSheet.Cells(startIndex, 7).Value = "N"
  23.         End If
  24.        
  25.         Else
  26.         startIndex = startIndex + 1
  27.         currentNr = ActiveSheet.Cells(startIndex, 1).Value
  28.         End If
  29.     Next i
  30.    
  31. End Sub
Add Comment
Please, Sign In to add comment