Is it possible to expand the range expression in vba?It seems that you can string, but is it possible to range it?What I want to do is the code below.
'This code succeeded
subcellcolor
for i = 3 to 27 step 4
for j = 1 to 13
cells(i,j).interior.colorindex=3
cells(i+1,j).interior.colorindex=4
cells(i+2,j).interior.colorindex=5
next j —next i
end sub
subsippai
set range=range.format("a{i}", "m{i}")
for i = 3 to 27 step 4
r.interior.colorindex=3
next i
End sub
You have rows() to select the
substep_row
for i = 3 to 27 step 4
rows(i).interior.colorindex=3
next i
end sub
However, there is a problem that the entire line has been selected and cannot be stopped where you want to.
© 2023 OneMinuteCode. All rights reserved.