samedi 21 janvier 2023

Repeating Cell Fill In Randomly Selected Rows

I want to auto-fill the text "SOLD" to column K in each row from a pre-chosen set of rows not necessarily in sequential order. For ex: I may select rows 1-3 & maybe rows 8 & 10. Upon selecting said rows, I want to run my macro to enter the text "SOLD" in each of them.

Here is my current macro, which works only on one row at a time:

Sub ItemSold()

Range("K" & ActiveCell.Row).Select
ActiveCell.FormulaR1C1 = "SOLD"
Rows(ActiveCell.Row).Select

End Sub

I assume there's a way to cycle through all of the selected rows with FOR EACH or maybe a REPEAT function/?




Aucun commentaire:

Enregistrer un commentaire