Moderatori: Anthony47, Flash30005
Sub ConvertiDate()
Dim ur As Long
Dim rng As Range
Dim cel As Range
ur = Cells(Rows.Count, 1).End(xlUp).Row
Set rng = Range("A1:A" & ur)
For Each cel in rng
cel.Value = Left(cel.Value, 8)
Next cel
End Sub
Sub CambiaDate()
Dim ur As Long, i As Long
ur = Cells(Rows.Count, 4).End(xlUp).Row
For i = 1 To ur
If IsDate(Cells(i, 4)) Then
Cells(i, 4) = Int(Cells(i, 4).Value)
Cells(i, 4).NumberFormat = "dd/mm/yy;@"
End If
Next
End Sub
Sub CambiaDate()
Dim ur As Long, i As Long
ur = Cells(Rows.Count, 4).End(xlUp).Row
For i = 8 To ur
If IsDate(Cells(i, 4)) Then
Cells(i, 4) = Format(Cells(i, 4), "mm/dd/yy")
End If
Next
End Sub
Sub ConvertiDate()
Dim ur As Long
Dim rng As Range
Dim cel As Range
ur = Cells(Rows.Count, 1).End(xlUp).Row
Set rng = Range("D8:D" & ur)
For Each cel In rng
cel.Value = Left(cel.Value, 10)
Next cel
End Sub
Sub ELIMINA_RIGHE()
Dim UR As Long
With Sheets("Dettaglio")
UR = .Cells(.Rows.Count, 6).End(xlUp).Row
For n = UR To 8 Step -1
If .Cells(n, 6).Value = 0 Then
.Cells(n, 6).EntireRow.Delete
End If
Next n
End With
End Sub
Sub converti()
Range("B1").Select
ActiveCell.FormulaR1C1 = "1"
Range("B1").Select
Selection.Copy
Range("F8:F1000").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
Range("B1").Select
Application.CutCopyMode = False
Selection.ClearContents
End Sub
Sub ConvertiTesto()
Range("B1").Select
ActiveCell.FormulaR1C1 = "1"
Range("B1").Copy
UR = Cells(Rows.Count, 6).End(xlUp).Row
Range("F8:F" & UR).Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
Range("B1").Select
Application.CutCopyMode = False
Selection.ClearContents
End Sub
Sub ConvertiTesto2()
Dim UR As Long
Dim rng As Range
Dim cel As Range
Application.ScreenUpdating = False
UR = Cells(Rows.Count, 6).End(xlUp).Row
Set rng = Range("F8:F" & UR)
For Each cel In rng
cel.Value = cel.Value * 1
Next cel
End Sub
Sub ConvertiTesto2()
Dim UR As Long
Dim rng As Range
Dim cel As Range
Dim myT As Double
'
Application.ScreenUpdating = False
UR = Cells(Rows.Count, 6).End(xlUp).Row
Set rng = Range("F8:F" & UR)
For Each cel In rng
cel.Value = cel.Value * 1
myT = myT + cel.Value
Next cel
Application.ScreenUpdating = True
Cells(UR + 2, "F").Value = myT
End Sub
Sub Main()
Call ConvertiDate
Call ConvertiTesto2
Call ELIMINA_RIGHE
Call Macro1
End Sub
Cells(UR + 2, "F").Formula = "=sum(F1:F" & UR & ")"
Torna a Applicazioni Office Windows
Supporto per sviluppo macro VBA Ordinare per data Autore: Carletto Ribolla |
Forum: Applicazioni Office Windows Risposte: 3 |
Eliminare righe diverse dalla prima data del mese Autore: dipdip |
Forum: Applicazioni Office Windows Risposte: 4 |
Come impostare il formato data predefinito in excel? Autore: wallace&gromit |
Forum: Applicazioni Office Windows Risposte: 5 |
Macro sposta riga se data in colonna più vecchia di 3 mesi Autore: systemcrack |
Forum: Applicazioni Office Windows Risposte: 23 |
Visitano il forum: Nessuno e 37 ospiti