Hi Everybody,
I have created a code that goes through all rows of a column and apply some conditions and create values in other columns, vode works fine but i want code to loop through other columns, see my code below here i loop through column C but after column C is done i want to apply same loop to column D and so on.... So everything will stay same just column c needs to change each time, is there anyway to do this? Any help or clue will be appreciated much. Many thanks,
I have created a code that goes through all rows of a column and apply some conditions and create values in other columns, vode works fine but i want code to loop through other columns, see my code below here i loop through column C but after column C is done i want to apply same loop to column D and so on.... So everything will stay same just column c needs to change each time, is there anyway to do this? Any help or clue will be appreciated much. Many thanks,
Code:
sub trial ()
dim ep as integer
dim tp as integer
dim i as integer
dim j as integer
dim strt as integer
dim endt as integer
dim gval as integer
ep = 10
tp =10
worksheets("sheet1" ).select
for i = ep to ep+tp+4
strt = i-10
endt = strt +9
for j = strt to endt
if range("C" & i).value < 50 then
range("F" & j).value = range("E" & j).value *2
else: range("F" & j).value = range("E" & j).value
end if
gval = application.worksheetfunction.sum(range(cells(strt,6),cells(endt,6)))
range("G" & i).value = gval
next j
range("F5:F600"). clear
next i
end sub
[\code]