| | Post: 355 | Registrato il: 28/05/2011
| Città: MILANO | Età: 43 | Utente Senior | excel 2000/2007 | | OFFLINE | |
|
13/11/2016 08:36 | |
Salve a tutti,
con una macro è possibile inserire nella colonna M2:M243
numeri progressivi da 1 a 243?
Un greazie in anticipo.
john ---------------
excel 2007 |
|
| | Post: 414 | Registrato il: 16/08/2015
| Città: CORDENONS | Età: 67 | Utente Senior | Excel 2016-32bit Win11 | | OFFLINE |
|
13/11/2016 09:29 | |
Certo, però, dato che non è una operazione complessa, perché non provi a registrarti la macro in modo da avere la base già pronta per fare eventuali altre modifiche.
Nel menu di Excel clicca Registra Macro, nel foglio fai tutte le operazioni che faresti manualmente, alla fine di tutte le operazioni interrompi la registrazione ed in un modulo vba ti ritrovi la macro pronta per il riuso.
______________________________________________________________
C'è chi fa le COSE a CASO e chi fa CASO alle COSE (Ignoto) |
| | Post: 355 | Registrato il: 28/05/2011
| Città: MILANO | Età: 43 | Utente Senior | excel 2000/2007 | | OFFLINE | |
|
13/11/2016 09:52 | |
Ciao
così non va:
Sub Macro4()
Range("M4").Select
ActiveCell.FormulaR1C1 = "1"
Range("M5").Select
ActiveCell.FormulaR1C1 = "2"
Range("M6").Select
ActiveCell.FormulaR1C1 = "3"
Range("M7").Select
ActiveCell.FormulaR1C1 = "4"
Range("M8").Select
ActiveCell.FormulaR1C1 = "5"
Range("M9").Select
ActiveCell.FormulaR1C1 = "6"
Range("M10").Select
ActiveCell.FormulaR1C1 = "7"
Range("M11").Select
ActiveCell.FormulaR1C1 = "8"
Range("M12").Select
ActiveCell.FormulaR1C1 = "9"
Range("M13").Select
ActiveCell.FormulaR1C1 = "10"
Range("M14").Select
ActiveCell.FormulaR1C1 = "11"
Range("M15").Select
ActiveCell.FormulaR1C1 = "12"
Range("M16").Select
ActiveCell.FormulaR1C1 = "13"
Range("M17").Select
ActiveCell.FormulaR1C1 = "14"
Range("M18").Select
ActiveCell.FormulaR1C1 = "15"
Range("M4").Select
End Sub
---------------
excel 2007 |
| | Post: 1.905 | Registrato il: 21/03/2008
| Città: LOCATE VARESINO | Età: 76 | Utente Veteran | 2007 / 13 | | OFFLINE | |
|
13/11/2016 10:23 | |
ciao
un semplice ciclo For
Sub DaM2aM244_step1()
Dim i As Long
For i = 1 To 243
Cells(i + 1, "M") = i
Next i
End Sub
Ciao da locate
excel 2007 / 13 |
| | Post: 356 | Registrato il: 28/05/2011
| Città: MILANO | Età: 43 | Utente Senior | excel 2000/2007 | | OFFLINE | |
|
13/11/2016 10:45 | |
Ciao locate è o.k..
E' possibile velocizzala?
Questo cliclo for è dentro ad un'altra macro che ora è molto rallentata.
Grazie ancora.
john ---------------
excel 2007 |
| | Post: 437 | Registrato il: 02/08/2015
| Utente Senior | Excel 2013 | | OFFLINE |
|
13/11/2016 11:35 | |
john_cash, 13/11/2016 10.45:
Ciao locate è o.k..
E' possibile velocizzala?
Questo cliclo for è dentro ad un'altra macro che ora è molto rallentata.
Grazie ancora.
john
Ciao a tutti,
@john_cash
senza vedere la macro completa (in un file d'esempio se non puoi postare l'originale) difficile fare delle prove per riuscire a velocizzarla.
"Sono le persone che nessuno immagina che possano fare certe cose, quelle che fanno cose che nessuno può immaginare." |
| | Post: 438 | Registrato il: 02/08/2015
| Utente Senior | Excel 2013 | | OFFLINE |
|
13/11/2016 11:42 | |
[EDIT]
Al posto del ciclo For...Next, potresti usare "AutoFill":
Sub progressivi()
Range("M2").Value = 1
Range("M3").Value = 2
Range("M2:M3").AutoFill Destination:=Range("M2:M243"), Type:=xlFillDefault
End Sub
"Sono le persone che nessuno immagina che possano fare certe cose, quelle che fanno cose che nessuno può immaginare." |
| | Post: 357 | Registrato il: 28/05/2011
| Città: MILANO | Età: 43 | Utente Senior | excel 2000/2007 | | OFFLINE | |
|
13/11/2016 20:50 | |
Ciao cromagno è molto più veloce.
Grazie a tutti.
john ---------------
excel 2007 |
|
|