I have this code... when I click CommandButton1 it does what it is suppsed to do but after the command
Selection.Insert Shift:=xlDown
the code goes to
Private Sub CMBCliente_Change()
______________________________________
Private Sub CMBCliente_Change()
'Trova riga cliente
Dim Clienti As Worksheet
Set Clienti = Sheets("Clienti")
Set Cerca = Clienti.Range("B:B").Find(What:=Me.CMBCliente.Value)
Dim RigaCliente As Variant
RigaCliente = Cerca.Row
'Copia dati
Dim BConf As Worksheet
Set BConf = Sheets("BConfirmation")
BConf.Cells(10, 6) = Clienti.Cells(RigaCliente, 2)
BConf.Cells(11, 6) = Clienti.Cells(RigaCliente, 3)
BConf.Cells(12, 6) = Clienti.Cells(RigaCliente, 4)
BConf.Cells(13, 6) = Clienti.Cells(RigaCliente, 5)
BConf.Cells(13, 7) = Clienti.Cells(RigaCliente, 6)
BConf.Cells(14, 6) = Clienti.Cells(RigaCliente, 7)
BConf.Cells(15, 6) = Clienti.Cells(RigaCliente, 8)
End Sub
______________________________________
Private Sub CommandButton1_Click()
' Inserisci_riga Macro
Dim nr As Integer
nr = 33
Do Until Cells(nr, 1).Value = ""
nr = nr + 1
Loop
Set BCSheet = ThisWorkbook.Sheets("BConfirmation")
ActiveSheet.Unprotect "123"
Sheets("Foglio1").Visible = True
Sheets("Foglio1").Select
Sheets("Foglio1").Range("4:4").Copy
Sheets("Foglio1").Visible = xlVeryHidden
Sheets("BConfirmation").Select
Rows(nr).Select
Selection.Insert Shift:=xlDown
Application.CutCopyMode = False
ActiveSheet.Protect "123", True, True
End Sub
Selection.Insert Shift:=xlDown
the code goes to
Private Sub CMBCliente_Change()
______________________________________
Private Sub CMBCliente_Change()
'Trova riga cliente
Dim Clienti As Worksheet
Set Clienti = Sheets("Clienti")
Set Cerca = Clienti.Range("B:B").Find(What:=Me.CMBCliente.Value)
Dim RigaCliente As Variant
RigaCliente = Cerca.Row
'Copia dati
Dim BConf As Worksheet
Set BConf = Sheets("BConfirmation")
BConf.Cells(10, 6) = Clienti.Cells(RigaCliente, 2)
BConf.Cells(11, 6) = Clienti.Cells(RigaCliente, 3)
BConf.Cells(12, 6) = Clienti.Cells(RigaCliente, 4)
BConf.Cells(13, 6) = Clienti.Cells(RigaCliente, 5)
BConf.Cells(13, 7) = Clienti.Cells(RigaCliente, 6)
BConf.Cells(14, 6) = Clienti.Cells(RigaCliente, 7)
BConf.Cells(15, 6) = Clienti.Cells(RigaCliente, 8)
End Sub
______________________________________
Private Sub CommandButton1_Click()
' Inserisci_riga Macro
Dim nr As Integer
nr = 33
Do Until Cells(nr, 1).Value = ""
nr = nr + 1
Loop
Set BCSheet = ThisWorkbook.Sheets("BConfirmation")
ActiveSheet.Unprotect "123"
Sheets("Foglio1").Visible = True
Sheets("Foglio1").Select
Sheets("Foglio1").Range("4:4").Copy
Sheets("Foglio1").Visible = xlVeryHidden
Sheets("BConfirmation").Select
Rows(nr).Select
Selection.Insert Shift:=xlDown
Application.CutCopyMode = False
ActiveSheet.Protect "123", True, True
End Sub