Just replace 'ActiveCell' with 'Selection', thus:
With Selection
.Numberformat="General"
.Value= "Whatever"
End With
and it will do it for the whole selected area at once. alternatively, if
you don't want to have to select the area of interest first, just specify it
a range ie replace 'Selection' with 'Range("C2:Q16")'.
"Jos Vens" wrote:
Hi,
you can combine 2 for-loops
for i=1 to 10
for j=1 to 10
cells(i,j).numberformat = "General"
cells(i,j).value = "whatever"
next
next
i = rows
j = columns
Greetings
Jos Vens
"Ramthebuffs"
schreef in bericht
...
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
--
Ramthebuffs
------------------------------------------------------------------------
Ramthebuffs's Profile:
http://www.excelforum.com/member.php...o&userid=16429
View this thread: http://www.excelforum.com/showthread...hreadid=482958