ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Loop till value changes (https://www.excelbanter.com/excel-discussion-misc-queries/200173-loop-till-value-changes.html)

Ruben

Loop till value changes
 
I am making a code in visual basic that has to loop till the value in column
C changes. But I don't know how I can put in the code "loop till value in
column C changes". Would be great if someone could help me! Thanks!

Bob Phillips[_3_]

Loop till value changes
 

i = 2

Do While Cells(i, "C").Value = Cells(i - 1, "C").Value

i = i + 1
Loop

on exit, Cells(i, "C") will point at the changed cell

--
__________________________________
HTH

Bob

"Ruben" wrote in message
...
I am making a code in visual basic that has to loop till the value in
column
C changes. But I don't know how I can put in the code "loop till value in
column C changes". Would be great if someone could help me! Thanks!




Ruben

Loop till value changes
 
Bob, thanks for your reaction!

Ruben


"Bob Phillips" wrote:


i = 2

Do While Cells(i, "C").Value = Cells(i - 1, "C").Value

i = i + 1
Loop

on exit, Cells(i, "C") will point at the changed cell

--
__________________________________
HTH

Bob

"Ruben" wrote in message
...
I am making a code in visual basic that has to loop till the value in
column
C changes. But I don't know how I can put in the code "loop till value in
column C changes". Would be great if someone could help me! Thanks!






All times are GMT +1. The time now is 07:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com