
Sub formula()
'
' formula Macro
'
For i = 0 To 30
Cells(16, 30).Value = Cells(24 + i, 25)
Cells(24 + i, 26).Value = Cells(16, 36)
Cells(20, 15).Value = Cells(24 + i, 29)
Cells(24 + i, 28).Value = Cells(20, 21)
Cells(45 + i, 25).Select
ActiveCell.FormulaR1C1 = _
"=R[-1]C+(R[-1]C[3]*(((R17C15*R12C15)/(R13C3*R6C3))+1)*R21C25)"
If Cells(24 + i, 24).Value = Cells(21, 28) Then
Exit For
End If
Next
End Sub
IO HO PROVATO A SOSTITUIRE LA FORMULA CON:
Cells(45 + i, 25).Select
ActiveCell.FormulaR1C1 = _
"= Cells(45 + i-1, 25)+(Cells(45 + i-1, 28)*(((Cells(17, 15)*Cells(12, 15))/(Cells(13, 3)*Cells(6, 3))+1)*Cells(21, 25))"
MA NON VA |
ActiveCell.FormulaR1C1 = "=SUM(R[-7]C:R[-1]C)" ActiveCell.FormulaLocal = "=SOMMA(A1:A7)" |
For i = 0 To 30 |
=Y41+(AB41*((($O$17*$O$12)/($C$13*$C$6))+1)*$Y$21) |
=Y41+(AB41*((($O$17*$O$12)/($C$13*$C$6))+1)*$Y$21) |
Application.ScreenUpdating = False
Range("X27:AC27").Copy
Range("X27").Select
Do
ActiveCell.Offset(1).Select
Loop Until ActiveCell.Value = ""
ActiveSheet.Paste
ActiveCell.Offset(0, -1).Select
x = ActiveCell(-1).Value
ActiveCell.Value = x + 1
Application.CutCopyMode = False
Application.ScreenUpdating = True |
ActiveCell.Offset(0, -1).Select
x = ActiveCell(-1).Value
ActiveCell.Value = x + 1 |
Application.ScreenUpdating = False
'copia questa riga
Range("X27:AC27").Copy
vai in x27
Range("X27").Select
scendi di una riga fino a quando cella e' vuota
Do
ActiveCell.Offset(1).Select
Loop Until ActiveCell.Value = ""
incolla
ActiveSheet.Paste
stessa riga ma spostati indietro di una cella
quindi cella w
ActiveCell.Offset(0, -1).Select
la variabile x assume come valore il valore della cella w precedente (il numero progressivo per capirci)
x = ActiveCell(-1).Value
lo incrementa di uno e lo copia nella cella vuota
ActiveCell.Value = x + 1
Application.CutCopyMode = False
Application.ScreenUpdating = True
|
Range("X27:AC27").Copy
Ho provato
Range("X27;AC27").Copy
ma non va e nella guida non riesco a trovarlo. |
Range("X27").SELECT
SELECTION.COPY
Do
ActiveCell.Offset(1).Select
Loop Until ActiveCell.Value = ""
ActiveSheet.Paste
Range("AC27").SELECT
SELECTION.COPY
Do
ActiveCell.Offset(1).Select
Loop Until ActiveCell.Value = ""
ActiveSheet.Paste
|
Sub ciclo()
'
' ciclo Macro
'
For i = 0 To 15
Application.ScreenUpdating = False
Range("X26:Y26").Select 'fatto partire dal 26 per non copiare anche i colori
Selection.Copy
Do
ActiveCell.Offset(1).Select
Loop Until ActiveCell.Value = ""
ActiveSheet.Paste
ActiveCell.Offset(0, -1).Select
x = ActiveCell(-1).Value
ActiveCell.Value = x + 2
Application.CutCopyMode = False
Application.ScreenUpdating = True
Cells(16, 30).Value = Cells(27 + i, 25) 'pongo la nuova s per trovare tau
Cells(27 + i, 26).Value = Cells(16, 36) 'cosi ho la tau del nuovo passo
Range("AC26").Select
Selection.Copy
Do
ActiveCell.Offset(1).Select
Loop Until ActiveCell.Value = ""
ActiveSheet.Paste
Cells(20, 15).Value = Cells(27 + i, 29) 'pongo la nuova sigma
Cells(27 + i, 28).Value = Cells(20, 21) 'cosi ho la epsilon del nuovo passo
Range("AA26").Select
Selection.Copy
Do
ActiveCell.Offset(1).Select
Loop Until ActiveCell.Value = ""
ActiveSheet.Paste
If Cells(27 + i, 24).Value >= Cells(21, 28) Then 'quando arrivo a L=10cm=100mm ferma il calcolo
Exit For
End If
Next
End Sub
PER CANCELLARE RIGA IF (partendo dalla cella che verifica la condizione)
Set mySheet = myChart.Application.DataSheet
mySheet.Range("W1:AC10").Delete
Dove W è la cella che verifica la condizione
|
If Cells(27 + i, 24).Value >= Cells(21, 28) Then 'quando arrivo a L=10cm=100mm ferma il calcolo
Exit For
End If
IPOTESI................................
If Cells(27 + i, 24).Value >= Cells(21, 28) Then 'quando arrivo a L=10cm=100mm ferma il calcolo
Cells(27 + i, 24).FONT.BOLD = TRUE
Exit For
End If
|
If Cells(27 + i, 24).Value >= Cells(21, 28) Then 'quando arrivo a L=10cm=100mm ferma il calcolo Cells(27 + i, 24).Interior.ColorIndex = 3 EXIT FOR |
If Cells(27 + i, 24).Value >= Cells(21, 28) Then
Range("Cells(27 + i, 24):Cells(27 + i, 29)").Delete
Il desiderio sarebbe cancellare il contenuto delle celle della riga 27+i da colonna 24 a 29 |
Range("Cells(27 + i, 24):Cells(27 + i, 29)").Delete Shift:=xlUp
|
