Moderatori: Anthony47, Flash30005
' ================================
' INCOLONNA PER BANCA (Iwbank)
' ================================
Private Sub Incolonna_Iwbank()
Application.ScreenUpdating = False
Dim RigNum As Long
Dim x As Long
Dim y As Long
Sheets("InsDati").Select
RigNum = Application.WorksheetFunction.CountA(Columns("A"))
Sheets("Dett_Iwbank").Select
Range(Cells(2, 1), Cells(1048576, 18)).ClearContents
y = 1
For x = 2 To RigNum
Sheets("InsDati").Select
If Cells(x, 1) = "Iwbank" Then
y = y + 1
Range(Cells(x, 1), Cells(x, 18)).Select
Selection.Copy
Sheets("Dett_Iwbank").Select
Range(Cells(y, 1), Cells(y, 18)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
End If
Next x
Exita:
'riposiziono il cursore nelle prima cella vuota
Sheets("InsDati").Select
Cells(x, 1).Select
'autoadatta larghezza colonne
Sheets("Dett_Iwbank").Select
Cells.Select
Selection.Columns.AutoFit
Range("A1").Select
'riposiziono il cursore sulla prima cella vuota
Cells(y + 2, 1).Select
End Sub
Sub zzz()
Dim WsSorg As Worksheet, WsDett As Worksheet
Dim I As Long, RigNum As Long, myNext As Long, myBank As String
'
Set WsSorg = Sheets("InsDati") '<<< Foglio di Origine
Set WsDett = Sheets("Dett_Iwbank") '<<< Foglio per elenco filtrato
myBank = "Iwbank" '<<< banca
'
mytim = Timer
WsDett.Select
Range("A1").Resize(Rows.Count, 18).Clear
RigNum = WsSorg.Cells(Rows.Count, 1).End(xlUp).Row
For I = 2 To RigNum
If WsSorg.Cells(I, 1) = myBank Then
myNext = myNext + 1
Cells(myNext, 1).Resize(1, 18).Value = WsSorg.Cells(I, 1).Resize(1, 18).Value
End If
Next I
Cells(myNext + 1, 1).Select
WsSorg.Range("A2:S2").Copy
Range("A1").Resize(myNext, 18).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Range("A:S").Columns.AutoFit
MsgBox ("Completato " & Format(Timer - mytim, "00.00"))
End Sub
Sub zzz2()
Dim WsSorg As Worksheet, WsDett As Worksheet
Dim I As Long, RigNum As Long, myNext As Long, myBank As String
'
Set WsSorg = Sheets("InsDati") '<<< Foglio di Origine
Set WsDett = Sheets("Dett_Iwbank") '<<< Foglio per elenco filtrato
myBank = "Iwbank" '<<< banca
'
mytim = Timer
WsDett.Range("A2").Resize(Rows.Count - 1, 18).Clear '***
WsDett.Select
Range("A1").Resize(Rows.Count, 18).Clear
RigNum = WsSorg.Cells(Rows.Count, 1).End(xlUp).Row
For I = 2 To RigNum
If WsSorg.Cells(I, 1) = myBank And (WsSorg.Cells(I, 4) = "Long" Or WsSorg.Cells(I, 4) = "Short") Then
myNext = myNext + 1
Cells(myNext, 1).Resize(1, 18).Value = WsSorg.Cells(I, 1).Resize(1, 18).Value
End If
Next I
Cells(myNext + 1, 1).Select
WsSorg.Range("A2:S2").Copy
Range("A1").Resize(myNext, 18).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Range("A:S").Columns.AutoFit
MsgBox ("Completato " & Format(Timer - mytim, "00.00"))
End Sub
WsSorg.Range("A3:S3").Copy
Range("A2").Resize(myNext, 18).PasteSpecial xlPasteFormats
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 |
Macro per aprire file salvato su sharepoint Onedrive Autore: marcopont |
Forum: Applicazioni Office Windows Risposte: 2 |
Come interrompere macro sndPlaySound Autore: systemcrack |
Forum: Applicazioni Office Windows Risposte: 2 |
Visitano il forum: Nessuno e 23 ospiti