Moderatori: Anthony47, Flash30005
For I=Cells(Rows.count, "A").End(xlup).Row to 2 step -1
If Cells(I, "BB").Value = 0 or Cells(I, "BB").Value = "" then
Rows(I).Delete Shift:=xlUp
End If
Next I
Sub Distrib()
Dim myList As Worksheet, byA As Worksheet
Dim I As Long, cAuth As String, J As Long, myNext As Long, myMatch
'
Set myList = Sheets("LIST")
Set byA = Sheets("BY author")
'
byA.Range("A:F").Clear
With myList
For I = 2 To .Cells(Rows.Count, 1).End(xlUp).Row
cAuth = .Cells(I, 1)
myMatch = Application.Match(cAuth, byA.Range("A:A"), 0)
If IsError(myMatch) Then
myNext = byA.Cells(Rows.Count, 2).End(xlUp).Row + 2
If myNext < 4 Then myNext = 1
byA.Range("block").Copy byA.Cells(myNext, 1)
byA.Cells(myNext + 1, 1).Value = cAuth
myMatch = myNext + 1
End If
For J = 1 To 1000
If byA.Cells(myMatch + 1 + J, 2) = "" Then
myNext = myMatch + 1 + J
Exit For
End If
Next J
.Cells(I, 2).Resize(1, 4).Copy byA.Cells(myNext, 2)
byA.Cells(myNext, 1) = "o"
byA.Cells(myNext + 1, 1).Resize(1, 6).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Next I
End With
MsgBox ("Completato...")
End Sub
With myList
For I = 2 To .Cells(Rows.Count, 1).End(xlUp).Row
cAuth = .Cells(I, 1)
If cAuth <> "" Then
myMatch = Application.Match(cAuth, byA.Range("A:A"), 0)
If IsError(myMatch) Then
myNext = byA.Cells(Rows.Count, 2).End(xlUp).Row + 2
If myNext < 4 Then myNext = 1
byA.Range("block").Copy byA.Cells(myNext, 1)
byA.Cells(myNext + 1, 1).Value = cAuth
myMatch = myNext + 1
End If
For J = 1 To 1000
If byA.Cells(myMatch + 1 + J, 2) = "" Then
myNext = myMatch + 1 + J
Exit For
End If
Next J
.Cells(I, 2).Resize(1, 4).Copy byA.Cells(myNext, 2)
byA.Cells(myNext, 1) = "o"
byA.Cells(myNext + 1, 1).Resize(1, 6).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
End If
Next I
End With
Shapes.AddPicture site:pc-facile.com
Sub DistribImm()
'Gestisce Immagine autore
Dim myList As Worksheet, byA As Worksheet
Dim I As Long, cAuth As String, J As Long, myNext As Long, myMatch
'
Set myList = Sheets("LIST")
Set byA = Sheets("BY author")
'
byA.Select
On Error GoTo gExit
ActiveSheet.Shapes("ZCZC_NN").Visible = False
On Error GoTo 0
For I = ActiveSheet.Shapes.Count To 1 Step -1
If Left(ActiveSheet.Shapes(I).Name, 10) = "ZCZC__COPY" Then
ActiveSheet.Shapes(I).Delete
ElseIf Left(ActiveSheet.Shapes(I).Name, 5) = "ZCZC_" Then
ActiveSheet.Shapes(I).Visible = False
End If
Next I
'
byA.Range("A:F").Clear
With myList
For I = 2 To .Cells(Rows.Count, 1).End(xlUp).Row
cAuth = .Cells(I, 1)
If cAuth <> "" Then
myMatch = Application.Match(cAuth, byA.Range("A:A"), 0)
If IsError(myMatch) Then
myNext = byA.Cells(Rows.Count, 2).End(xlUp).Row + 2
If myNext < 4 Then myNext = 1
On Error Resume Next
myn = "": myn = ActiveSheet.Shapes("ZCZC_" & cAuth).Name
On Error GoTo 0
If myn = "" Then
ActiveSheet.Shapes.Range(Array("ZCZC_NN")).Visible = True
ActiveSheet.Shapes.Range(Array("ZCZC_NN")).Select
Selection.Copy
Cells(myNext, 2).Select
ActiveSheet.Paste
Selection.Name = "ZCZC__COPY" & myNext
myn = "ZCZC__COPY" & myNext
ActiveSheet.Shapes.Range(Array("ZCZC_NN")).Visible = False
Else
myn = "ZCZC_" & cAuth
End If
With ActiveSheet.Shapes(myn)
.Visible = True
.Top = Cells(myNext, 2).Top
.Left = Cells(1, 2).Left
.LockAspectRatio = True
.Height = Cells(myNext, 2).Resize(3, 1).Height
If .Width > Cells(1, 2).Width Then .Width = Cells(1, 2).Width
Cells(myNext, 1).Select
End With
byA.Range("block").Copy byA.Cells(myNext, 1)
byA.Cells(myNext + 1, 1).Value = cAuth
myMatch = myNext + 1
End If
For J = 1 To 1000
If byA.Cells(myMatch + 1 + J, 2) = "" Then
myNext = myMatch + 1 + J
Exit For
End If
Next J
.Cells(I, 2).Resize(1, 4).Copy byA.Cells(myNext, 2)
byA.Cells(myNext, 1) = "o"
byA.Cells(myNext + 1, 1).Resize(1, 6).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
End If
Next I
End With
MsgBox ("Completato...")
Exit Sub
gExit:
MsgBox ("Non ho trovato la foto di default, procedura abortita" & vbCrLf & _
"(usa Sub Distrib per creare una lista senza immagini")
End Sub
Torna a Applicazioni Office Windows
Formattzione valori con simbolo triangolini colorati Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 11 |
Aggiornare cella con somma quando aggiungo nuova colonna Autore: marcopont |
Forum: Applicazioni Office Windows Risposte: 1 |
Stabilire righe e colonne da mostrare a schermo Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 10 |
Eliminare righe diverse dalla prima data del mese Autore: dipdip |
Forum: Applicazioni Office Windows Risposte: 4 |
Visitano il forum: Nessuno e 7 ospiti