Thread: loop
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ken Wright Ken Wright is offline
external usenet poster
 
Posts: 634
Default loop

Sub Chng()
For Each Cel In Range("C4:H9")
Cel.Value = Cel.Value * 2
Next Cel
End Sub

or

Sub Chng()
Set Rng = Range("C4:H9")
For Each Cel In Rng
Cel.Value = Cel.Value * 2
Next Cel
End Sub

etc

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------



"LiSa" wrote in message
...
Hi

I know you can do a loop for each worksheet in the
workbook, but can you do one for each cell within a range
eg C4:H9
If so, how ?

ty :)



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.703 / Virus Database: 459 - Release Date: 10/06/2004