Hi
I have three columns
Name Grade Number
Jack A 1
John B 2
Jill C 3
David D 4
Harry E 5
Tom F 6
I want to make the number zero for all selected cells.
For example. Say I select Jack and John OR A and B. I want to make the numbers 1 and 2 as zero.
I currently know how to do if only one cell is selected. But what if a range of cells is selected?
How do I loop the macro to run for each cell in active range. I have attached the excel file with a macro for further clarification. I want that code to loop for all cells in active range.
New Microsoft Excel Worksheet.xlsm
Please assume I don't know the boundaries of the active range. There can be three rows, four rows or even ten rows.
I have tried the following code. However that makes all the numbers in the "Number" column zero. I just want the active rows numbers to become zero.
Formula:
For Each c In ActiveCell.CurrentRegion.Cells
Range("A1").Offset(c.Row - 1, 2) = 0
Next
Bookmarks