Ciao Andrea.
Questo è il codice che uso:
Private Sub Worksheet_Activate()
Dim rng As Range
ActiveSheet.DisplayPageBreaks = True ' tratteggio pagina
Rem +++ Inizio carica i dati nella ComboBox +++
Set rng = Workbooks("AAvvio.xlsm").Sheets("ArchivioCondomini").Range("B4:D60")
With Me.ComboBox1
.Clear
.ColumnCount = 3
.ColumnWidths = "30;100;100" ' Larghezza colonne in Listato della ComboBox
.List = rng.Value
End With
Set rng = Workbooks("AAvvio.xlsm").Worksheets("ArchivioFornitori").Range("B4:F400")
With Me.ComboBox2
.Clear
.ColumnCount = 5
.ColumnWidths = "25;35;105;105;105" ' Larghezza colonne in Listato della ComboBox
.List = rng.Value
End With
Rem +++ Fine carica i dati nella ComboBox +++
Range("B1").Activate
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Column = 13 And ActiveCell.Row = 7 Then
Worksheets("Condominio").Range("B63") = 617 ' UserForm0.Left
If ActiveCell.Row = 7 Then
Worksheets("Condominio").Range("B62") = 187 ' UserForm0.Top
UserForm0.Show vbModeless
End If
End If
If ActiveCell.Column = 17 And (ActiveCell.Row = 24 Or ActiveCell.Row = 32) Then
Worksheets("Condominio").Range("B63") = 617 ' UserForm0.Left
If ActiveCell.Row = 24 Then
Worksheets("Condominio").Range("B62") = 410 ' UserForm0.Top
UserForm0.Show vbModeless
End If
If ActiveCell.Row = 32 Then
Worksheets("Condominio").Range("B62") = 507 ' UserForm0.Top
UserForm0.Show vbModeless
End If
End If
'Dim rng As Range
'
' Set rng = Union(Range("M7"), Range("Q24"))
'
' If Not Intersect(Target, rng) Is Nothing Then UserForm0.Show vbModeless
'
' Set rng = Nothing
End Sub
Grazie.
Ciao.
Nunzio.