Moderatori: Anthony47, Flash30005
Function ShExists(ByVal ShName As String) As Boolean
Dim ckEr As String
'
On Error Resume Next
ckEr = Sheets(ShName).Name
On Error GoTo 0
ShExists = (ckEr = ShName)
End Function
If ShExists(Range("A2").Value) Then
'Cosa fare se il foglio esiste
Else
'Cosa fare se il foglio non esiste
End If
currSheet = CStr(ActiveCell.Value)
If ShExists(currSheet) Then
Application.Intersect(Range("D:G"), ActiveCell.CurrentRegion).Copy
Sheets(currSheet).Range("C11").PasteSpecial xlPasteValues
Application.CutCopyMode = False
End If
For I = 5 To Cells(Rows.Count, "C").End(xlUp).Row
If Cells(I, "C") <> "" Then 'Esiste un nome foglio in cella
'cosa fare?
End If
Next I
Sub globAlb()
Dim I As Long, lastSh As Long, currSheet As String
Dim myNext As Long, myR
'
Sheets("Elenco").Select
lastSh = Cells(Rows.Count, "C").End(xlUp).Row
For I = 5 To lastSh
currSheet = Cells(I, "C")
If currSheet <> "" Then
If Not ShExists(currSheet) Then
Worksheets.Add after:=Worksheets.Count
ActiveSheet.Name = cSh
End If
Sheets("Elenco").Select
myNext = Sheets(currSheet).Cells(Rows.Count, "C").End(xlUp).Row + 1
Set myR = Application.Intersect(Range("D:G"), Cells(I, "C").CurrentRegion)
If Not myR Is Nothing Then
myR.Copy
Sheets(currSheet).Cells(myNext, "C").PasteSpecial xlPasteValues 'Nota**
End If
Application.CutCopyMode = False
End If
Next I
End Sub
Private Sub CommandButton1_Click()
'Call CreaFoglio(Sheets("Elenco").Range("c5:c35")) '<<< Si puo' anche eliminare
Call globAlb '<<< AGGIUNTA
End Sub
Torna a Applicazioni Office Windows
Macro modifica date scelta periodo Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 11 |
Supporto per sviluppo macro VBA Ordinare per data Autore: Carletto Ribolla |
Forum: Applicazioni Office Windows Risposte: 3 |
Visitano il forum: Nessuno e 11 ospiti