Moderatori: Anthony47, Flash30005
Private Sub Worksheet_Change(ByVal Target As Range)
UR = Range("A" & Rows.Count).End(xlUp).Row
CheckArea = "J" & UR & ",K" & UR & ",L" & UR & ",N" & UR & ",O" & UR
If Not Application.Intersect(ActiveCell, Range(CheckArea)) Is Nothing Then
ActiveCell.Validation.Delete
ActiveCell.Validation.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop, Operator:=xlBetween
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
UR = Range("A" & Rows.Count).End(xlUp).Row
CheckArea = "J" & UR & ",K" & UR & ",L" & UR & ",N" & UR & ",O" & UR
If Not Application.Intersect(ActiveCell, Range(CheckArea)) Is Nothing Then
If (Selection.Rows.Count + Selection.Columns.Count) > 2 Then Exit Sub
Select Case Target.Column
Case 10
Elenco = "=TipoG"
Case 11
Elenco = "=TipoC"
Case 12
Elenco = "=Fase"
Case 14
Elenco = "=Seguito"
Case 15
Elenco = "=prefabbricatore"
End Select
ActiveCell.Validation.Delete
ActiveCell.Validation.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:=Elenco
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
UR = Range("A" & Rows.Count).End(xlUp).Row
CheckArea = "J" & UR & ",K" & UR & ",L" & UR & ",N" & UR & ",O" & UR
If Not Application.Intersect(ActiveCell, Range(CheckArea)) Is Nothing Then
ActiveCell.Validation.Delete
ActiveCell.Validation.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop, Operator:=xlBetween
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
UR = Range("A" & Rows.Count).End(xlUp).Row
CheckArea = "J" & UR & ",K" & UR & ",L" & UR & ",N" & UR & ",O" & UR
CheckAreaA = "A" & UR + 1
If Not Application.Intersect(ActiveCell, Range(CheckArea)) Is Nothing Then
If (Selection.Rows.Count + Selection.Columns.Count) > 2 Then GoTo SaltaCA
Select Case Target.Column
Case 10
Elenco = "=TipoG"
Case 11
Elenco = "=TipoC"
Case 12
Elenco = "=Fase"
Case 14
Elenco = "=Seguito"
Case 15
Elenco = "=prefabbricatore"
End Select
ActiveCell.Validation.Delete
ActiveCell.Validation.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:=Elenco
End If
SaltaCA:
If Not Application.Intersect(ActiveCell, Range(CheckAreaA)) Is Nothing Then
If (Selection.Rows.Count + Selection.Columns.Count) > 2 Then Exit Sub
If UR < 12 Then
MsgBox "Formattare fino alla cella A12 inserendo Nr.Progetto"
Exit Sub
End If
Application.EnableEvents = False
Rows(UR - 1 & ":" & UR).Copy
Rows(UR & ":" & UR + 1).Select
ActiveSheet.PasteSpecial Format:=4, Link:=1, DisplayAsIcon:=False, IconFileName:=False
Bordo
Range("A" & UR + 1).Select
Application.EnableEvents = True
End If
End Sub
Public UR As Integer
Sub Bordo()
Range("A10:R" & UR + 1).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = 3
End With
End Sub
Alea ha scritto:purtroppo ho notato un piccolo difetto nella macro.
Alea ha scritto:Io avevo pensato di creare un'infinità di menu a tendina ma sinceramente non mi pare molto "bello" da vedere.
Torna a Applicazioni Office Windows
Inserimento parziale valore cella in MessageBox Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 6 |
Inserire add.in nella barra di avvio veloce in excel 2003 Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 4 |
Aggiornare cella con somma quando aggiungo nuova colonna Autore: marcopont |
Forum: Applicazioni Office Windows Risposte: 1 |
Excel: problema con date se devo unirle a testi Autore: valle1975 |
Forum: Applicazioni Office Windows Risposte: 5 |
Visitano il forum: Nessuno e 60 ospiti