Sélection de tableau excel vba

Fermé
fkuhn - 10 oct. 2006 à 16:50
 fkuhn - 10 oct. 2006 à 17:02
Bonjour, je suis débutant en vba!!

Je souhaiterai sélectionner automatiquement un tableau (je lái fait mais manuellement . copier coller de forums...) sachant que ce tableau comprend toujours les colonnes I3:P3 mais le nombre de lignes peut varier, j' comme vous le constatez, utilisé la fonction active sheet, dc mon tableau est sélectionner a priori! apres ca je souhaite utiliser les cellules de ma sélection pour les colorer et là g un bug!! il ne veux pas et je galere un peu!! Dáutant plus que le PC est espagnol, donc les msgs d'erreurs aussi et que je ne peux pas chger la langue(plusieurs utilisateurs)

voici mon programme , le probl`me (enfin pour l'instant est au début)


Sub Halloformato()
Dim Plage As Range, h, i&, Cell As Range, Rng As Range, j, k, m As Integer, n, p, q, s


ActiveSheet.Rows("I3 to P3").CurrentRegion.Select = Plage






For Each Cell In Plage
For i = 1 To Plage.Count
Set Rng = Cell.Offset(i)
If Cell <> "0" Then
Cell.Interior.ColorIndex = 4

Exit For
End If
Next i
Next Cell

For Each Cell In Plage
For i = 1 To Plage.Count
Set Rng = Cell.Offset(i)
If Rng <> "" And Rng = Cell Then
Cell.Interior.ColorIndex = 6
Rng.Interior.ColorIndex = 6
Exit For
End If
Next i
Next Cell



For Each Cell In Plage
For i = 1 To Plage.Count
Set Rng = Cell.Offset(i)
If Cell = "0" Then
Cell.Interior.ColorIndex = 34

Exit For
End If
Next i
Next Cell


For Each Cell In Plage

If Cell.Interior.Color = 6 And 4 Then
Cell = j

For j = 1 To Plage.Count
If j < j + 1 Then
j = j + 1


End If
Next j
End If

If Cell.Interior.Color = 6 And 4 Then
Cell = k

For k = 1 To Plage.Count
If k > k + 1 Then
k = k + 1

End If
Next k
End If
Next Cell




m = k - j


n = Inputbox("Numero de formato initial", "")

p = m / n

q = k - p
s = q - p




End Sub
A voir également:

1 réponse

aaaah!! desolé le msg n'est pas fini!!!

je remercie tout ceux aui essayerons de me donner un coup de pouce!!
je me doute que c super facile!!! mais moi je trouve ca super galere, alors une super solution me permetterai d'affronter un nouveau super probleme suivant!!

merci.

K1K1
0