Moderatori: Anthony47, Flash30005
AngyGates ha scritto:e qual è la sezione adatta?? :-((
è la prima volta che tento di scrivere in un forum...
grazieeeeeeeee
Public Ws1, Ws2 As Worksheet
Sub TraspTab()
Set Ws1 = Worksheets("Foglio1")
Set Ws2 = Worksheets("Foglio2")
Ws2.Cells.Clear
UR = Ws1.Range("A" & Rows.Count).End(xlUp).Row
Ws1.Range("A2:D" & UR).Copy Destination:=Ws2.Range("A1")
Ws1.Range("E2:H2").Copy Destination:=Ws2.Range("E1")
UR2 = Ws2.Range("A" & Rows.Count).End(xlUp).Row
Ws2.Range("A2:D" & UR2).Copy Destination:=Ws2.Range("A" & UR2 + 1)
Ws2.Range("A2:D" & UR2).Copy Destination:=Ws2.Range("A" & 2 * UR2)
Ws2.Range("A2:D" & UR2).Copy Destination:=Ws2.Range("A" & 3 * UR2 - 1)
Ws2.Columns("A:D").EntireColumn.AutoFit
Ws1.Range("H3:H" & UR).Copy Destination:=Ws2.Range("H2")
Ws1.Range("E3:E" & UR).Copy Destination:=Ws2.Range("E" & UR2)
Ws1.Range("F3:F" & UR).Copy Destination:=Ws2.Range("E" & 2 * UR2)
Ws1.Range("G3:G" & UR).Copy Destination:=Ws2.Range("E" & 3 * UR2 - 1)
Call FormattaTab
End Sub
Sub FormattaTab()
Ws2.Select
Range("E2:H65").Select
Application.CutCopyMode = False
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Range("G6").Select
End Sub
Torna a Applicazioni Office Windows
Macro modifica date scelta periodo Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 11 |
Inserire add.in nella barra di avvio veloce in excel 2003 Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 4 |
Excel: problema con date se devo unirle a testi Autore: valle1975 |
Forum: Applicazioni Office Windows Risposte: 5 |
Visitano il forum: Nessuno e 32 ospiti