Kod:
Private Sub CommandButton12_Click()
If ComboBox1 = "" Or ComboBox2 = "" Or TextBox4 = "" Then 'Boş alan engelle
MsgBox "Blok-Daire-İsim Boşgeçilemez!..", vbExclamation, "*© 2011*Irmak Yazılım"
Exit Sub
End If
If Range("A3").Value = "" Then
Range("A3").Select
ActiveCell.Value = ComboBox1
ActiveCell.Offset(0, 2) = TextBox4
ActiveCell.Offset(0, 5) = ComboBox1 & ComboBox2 & " " & TextBox4
ActiveCell.Offset(0, 6) = TextBox5
ActiveCell.Offset(0, 7) = ComboBox3
ActiveCell.Offset(0, 1) = ComboBox1 & ComboBox2
ActiveCell.Offset(0, 19) = ComboBox2
Else
[A65536].End(xlUp).Offset(1, 0).Select ' Boşlukları görür sıradaki satıra yazması için
ActiveCell.Value = ComboBox1
ActiveCell.Offset(0, 2) = TextBox4
ActiveCell.Offset(0, 5) = ComboBox1 & ComboBox2 & " " & TextBox4
ActiveCell.Offset(0, 6) = TextBox5
ActiveCell.Offset(0, 7) = ComboBox3
ActiveCell.Offset(0, 1) = ComboBox1 & ComboBox2
ActiveCell.Offset(0, 19) = ComboBox2
End If
Unload Me ' Formu yenile
UserForm23.Show
End Sub
Bu kodun Hem EndIf'e hemde Else kısmına aşağıdaki gibi bir şey eklemek istiyorum. Hücre üstteki hücreyi kopyalayacak. Excelde Ctrl+C Ctrl+V yapar gibi.
İlgili hücreler aşağıdaki gibidir.
ActiveCell.Offset(0, 3) = Ctrl+D
ActiveCell.Offset(0, 4) = Ctrl+D
