View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Rowan Drummond[_3_] Rowan Drummond[_3_] is offline
external usenet poster
 
Posts: 414
Default Multiple For/Next

You could try:

With Range("C2:Q16")
.NumberFormat = "General"
.Value = .Value
End With

Hope this helps
Rowan

Ramthebuffs wrote:
I'm trying to run the following code for each cell in range C2:Q16

ActiveCell.NumberFormat = "General"
ActiveCell.Value = ActiveCell.Value

I've put this as a loop, but would like to run it for rows C to Q
without having to put in Range("c" & I)...Range("d" & I)....ect

For I = 2 To 16
Range("C" & I).Select
ActiveCell.NumberFormat = "General"
ActiveCell.Value = ActiveCell.Value
next


I tried Range(& X & I).select, but it doesn't work. Where x = c to Q

There is probably a way to select a range C2:Q16 and then convert. Can
anyone help? I'd also like to know how to use two "For" statements in
combination, just for future reference.

Thanks guys