j'aimerai que dans une boucle 8 cellule de la même ligne soit dans 1 seule variable (Range)
mais je n'y arrive pas
j'avais penser a faire ceci
j = Range("A1").CurrentRegion.Rows.Count
Myrange = Range(ActiveCell.Cells(j, 1), ActiveCell.Cells(j, 3))
mais sa ne marche pas
par contre ceci fonctionne
Range(ActiveCell.Cells(j, 1), ActiveCell.Cells(j, 3)).Select
Sub selectionner_zone()
Dim myrange As Range
j = Range("A1").CurrentRegion.Rows.Count
Set myrange = Range(Cells(j, 1), Cells(j, 3))
'test macro: on colorie la zone sélectionnée myrange en jaune
myrange.Interior.ColorIndex = 6
Set myrange = Nothing
End Sub
il fallait déclarer et instancier myrange
activecell ne servait à rien
Vieux sujet mais j'espère que les membres sont toujours actifs!
Je suis pas baleze en VB etlà il faudrait que je recherche la première ou dernière cellule d'une colonne qui définit par une variable
En cherchant un peu, je suis tombé sur ça:
Dim MaPlage As Range
MaPlage = Cells(i, 21).Resize(i, 3600)
MaPlage.Cells(MaPlage.Cells.Count).Select
(avec i comme variable) mais ça ne fonctionne pas!