ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   "for each element in group" question (https://www.excelbanter.com/excel-programming/299629-each-element-group-question.html)

Claude

"for each element in group" question
 
Hi all

I want to use a "for each element in group" construct. How
can I go back one element during excecution,
e.g. if case1 then "go back one element".

Thanks for your help.

Frank Kabel

"for each element in group" question
 
Hi
post your existing code. General idea:
store the last value in a tempory variable

-----Original Message-----
Hi all

I want to use a "for each element in group" construct.

How
can I go back one element during excecution,
e.g. if case1 then "go back one element".

Thanks for your help.
.


Claude

"for each element in group" question
 
Hi Frank

For Each cell In Intersect(ActiveSheet.UsedRange, Range
("B:B"))
If IsError(cell.Value) Then
Rows(cell.Row).Delete Shift:=xlUp
'go back one element, e.g. cell.index = cell.index-
1
End If
Next cell

I'll try to solve this in another way, just wonder whether
how one can do this in this type of setup


-----Original Message-----
Hi
post your existing code. General idea:
store the last value in a tempory variable

-----Original Message-----
Hi all

I want to use a "for each element in group" construct.

How
can I go back one element during excecution,
e.g. if case1 then "go back one element".

Thanks for your help.
.

.


Tom Ogilvy

"for each element in group" question
 
Not aware of anyway to do that using For Each.

Most use a For i = Lastrow to Firstrow Step -1

when deleting rows.

--
Regards,
Tom Ogilvy

"Claude" wrote in message
...
Hi Frank

For Each cell In Intersect(ActiveSheet.UsedRange, Range
("B:B"))
If IsError(cell.Value) Then
Rows(cell.Row).Delete Shift:=xlUp
'go back one element, e.g. cell.index = cell.index-
1
End If
Next cell

I'll try to solve this in another way, just wonder whether
how one can do this in this type of setup


-----Original Message-----
Hi
post your existing code. General idea:
store the last value in a tempory variable

-----Original Message-----
Hi all

I want to use a "for each element in group" construct.

How
can I go back one element during excecution,
e.g. if case1 then "go back one element".

Thanks for your help.
.

.





All times are GMT +1. The time now is 09:46 PM.

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