View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tim Williams Tim Williams is offline
external usenet poster
 
Posts: 1,588
Default Repeat code over 300 rows

for i=2 to 300
me.cells(i,1).value=me.cells(i,4).value
next i

though it's not clear from your post whether A3 should equal D2 or D3....


Tim



"Patrick Simonds" wrote in message
...
How can I alter this code so that if performs the function not just on row
2 but all the way down through row 300. I Am sure I could repeat the code
for each of the 300 rows but I bet there is a better way.

Private Sub Worksheet_Calculate()
Me.Range("A2").Value = Me.Range("D2")
End Sub