Moderatori: Anthony47, Flash30005
Private Sub Worksheet_Change(ByVal Target As Range)
'Imposta altezza se Celle non vuote
'
Dim ckArea As String, defH As Single, enhH As Single
Dim myArea As Object, myC As Range
'
'Imposta i parametri:
ckArea = "A1:A100" '<<< L'area da esaminare
defH = 22 '<<< L'Altezza in pixel se cella vuota
enhH = 44 '<<< . . . . . . . . . .se cella piena
'
Set myArea = Application.Intersect(Target, Range(ckArea))
If Not myArea Is Nothing Then
For Each myC In myArea
If myC.Value = "" Then
myC.EntireRow.RowHeight = defH
Else
myC.EntireRow.RowHeight = enhH
End If
Next myC
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
'Aggiunge /Toglie riga vuota prima di Target
' USARE CON CAUTELA
'
Dim ckArea As String, defH As Single, enhH As Single
Dim myArea As Object, myC As Range
'
'Imposta i parametri:
''ckArea = "A1:A100" '<<< L'area da esaminare NO: Vedi TESTO
'
Set myArea = Application.Intersect(Target, Range("ckArea"))
If Not myArea Is Nothing Then
Application.EnableEvents = False
For Each myC In myArea
If myC.Value = "" Then
If Application.WorksheetFunction.CountA(myC.Offset(-1, 0).EntireRow) = 1 And _
myC.Offset(-1, 0).Value = " . " Then
myC.Offset(-1, 0).EntireRow.Delete Shift:=xlUp
Else
Beep
End If
Else
If myC.Offset(-1, 0).Value <> " . " Then
myC.EntireRow.Insert Shift:=xlDown
myC.Offset(-1, 0).Value = " . " 'Marker di riga aggiunta
End If
End If
Next myC
Application.EnableEvents = True
End If
End Sub
For Each myC In myArea
If myC.Value = "" Then
myC.EntireRow.RowHeight = defH
myC.EntireRow.Borders(xlEdgeTop).LineStyle = xlNone '+++
Else
myC.EntireRow.RowHeight = enhH
myC.EntireRow.Borders(xlEdgeTop).Weight = xlThick '+++
End If
Next myC
Private Sub Worksheet_Change(ByVal Target As Range)
'Imposta altezza se Celle non vuote
'
Dim ckArea As String, defH As Single, enhH As Single
Dim myArea As Object, myC As Range
'
'Imposta i parametri:
ckArea = "A5:g32" '<<< L'area da esaminare
defH = 15 '<<< L'Altezza in pixel se cella vuota
enhH = 20 '<<< . . . . . . . . . .se cella piena
'
Set myArea = Application.Intersect(Target, Range(ckArea))
For Each myC In myArea
If myC.Value = "" Then
myC.EntireRow.RowHeight = defH
myC.EntireRow.Borders(xlEdgeTop).LineStyle = xlNone '+++
Else
myC.EntireRow.RowHeight = enhH
myC.EntireRow.Borders(xlEdgeTop).Weight = xlThick '+++
End If
Next myC
End Sub
If Not myArea Is Nothing Then
Private Sub Worksheet_Change(ByVal Target As Range)
'Imposta altezza se Celle non vuote
'
Dim ckArea As String, defH As Single, enhH As Single
Dim myArea As Object, myC As Range
'
'Imposta i parametri:
ckArea = "A1:A100" '<<< L'area da esaminare
defH = 22 '<<< L'Altezza in pixel se cella vuota
enhH = 44 '<<< . . . . . . . . . .se cella piena
'
Set myArea = Application.Intersect(Target, Range(ckArea))
If Not myArea Is Nothing Then
For Each myC In myArea
If myC.Value = "" Then
myC.EntireRow.RowHeight = defH
myC.EntireRow.Borders(xlEdgeTop).LineStyle = xlNone '+++
Else
myC.EntireRow.RowHeight = enhH
myC.Resize(1, 6).Borders(xlEdgeTop).Weight = xlThick '+++
End If
Next myC
End If
End Sub
hai ragione con copia incolla si è persa quella riga, adesso vca bene.
la riga evidenziata è sempre lunghissima
Torna a Applicazioni Office Windows
Aggiornare cella con somma quando aggiungo nuova colonna Autore: marcopont |
Forum: Applicazioni Office Windows Risposte: 1 |
inserisci valore in celle a seguito di condizione Autore: ucame |
Forum: Applicazioni Office Windows Risposte: 10 |
Importare immagini a seconda del testo in una cella Autore: Paolo67met |
Forum: Applicazioni Office Windows Risposte: 4 |
Inserire valore di una cella in altra cella con testo Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 17 |
Visitano il forum: Nessuno e 44 ospiti