Looping through Cells

G

Guest

I need to loop through cells B9, B11, B13, B15, B17, B19, B21 (seven total)
and fill each with a date that is located in M4. End the process after the
last one

B9 = M4-13
B11 = M4-12
B13 = M4 -11
B15 = M4 -10
B17 = M4 -9
B19 = M4 -8
B21 = M4 -7

Any help is appreciated. Thanks
 
T

Tom Ogilvy

Sub AddDates()
Dim cell as Range, j as Long
j = 13
for each cell in Range("B9,B11,B13,B15,B17,B19,B21")
cell.Value = Range("M4").Value - j
cell.Numberformat = "mm/dd/yyyy"
j = j - 1
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top