Aiuto!!!!

Junior VBA

Nuovo Utente
12 Feb 2016
2
0
0
Ciao a tutti.. chiedo un rapido parere: dov è l'errore? perché mi dice sempre che c'è un Next senza For?

Sub Day()

Dim k As Integer, i As Integer


For k = 1 To 31

For i = 1 To 7

If i = 1 Then
Cells(c, 10) = sunday

Else

If i = 2 Then
Cells(c, 10) = monday

Else

If i = 3 Then
Cells(c, 10) = tuesday

Else

If i = 3 Then
Cells(c, 10) = wednesday

Else

If i = 4 Then
Cells(c, 10) = thursday

Else

If i = 5 Then
Cells(c, 10) = friday

Else

If i = 6 Then
Cells(c, 10) = saturday

End If

Next
Next


End Sub


Grazie mille!!!! :byebye:
 
penso che manchino tutti gli "end if", in vb ogni if va chiuso

poi fai "girare" 2 indici k ed i per ottenere un solo valore "Cells(c, 10)"

da buon ultimo perché non usare
Codice:
CHOOSE(myDay,"sunday","monday","tuesday","wednesday","thursday","friday","saturday")
risparmiando tutto quel codice inutile ?

ciao
Marino
 
Hai ragione!!! mi sono dimenticato di chiuderli, era da un bel pò che non usavo VBA... ooooops!! :)

grazie mille per tutte le dritte, gentilissimo!!!
 

Discussioni simili