Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 390
Default Looping through Cells

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Looping through Cells

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

--
Regards,
Tom Ogilvy

"Bill" wrote in message
...
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
reference cells when looping Isis[_2_] Excel Discussion (Misc queries) 5 April 29th 10 11:43 PM
Looping through cells using VBA Ann Excel Programming 2 December 22nd 05 12:05 AM
Faster Way of looping through cells Andibevan[_4_] Excel Programming 6 August 13th 05 07:59 AM
Looping on Cells with $x$y D.Parker Excel Programming 4 March 25th 05 11:31 AM
Looping through Cells Gary Paris[_2_] Excel Programming 5 December 25th 04 08:46 PM


All times are GMT +1. The time now is 09:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"