Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
or this...
If Selection.Count 1 Then Exit Sub For Each Cell In Selection.Resize(Selection.Count - 1) That "Exit Sub" should not be there (it was an accidental carry over from a copy/paste). It should have read this way... or this... If Selection.Count 1 Then For Each Cell In Selection.Resize(Selection.Count - 1) .... .... End If .... .... -- Rick (MVP - Excel) "Rick Rothstein" wrote in message ... Just resize the range you are looking through... For Each Cell In Selection.Resize(Selection.Count - 1) Note that if your selection is just a single cell, this code will generate an error, so you should check for that. May this... If Selection.Count = 1 Then Exit Sub For Each Cell In Selection.Resize(Selection.Count - 1) .... .... or this... If Selection.Count 1 Then Exit Sub For Each Cell In Selection.Resize(Selection.Count - 1) .... .... End If .... .... depending on how the rest of your code needs to be handled. -- Rick (MVP - Excel) "Luc" wrote in message ... The selection contains 1 column The number of rows is variable If i want to execute the "For Each cell In Selection" command, but i want the execute this for 1 row less than the actual selection...(the last row is not to be executed) How do i do this ? Thanx, Luc |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Limiting selection in a cell AND linking that selection to a list | Excel Discussion (Misc queries) | |||
Copy Selection - Transpose Selection - Delete Selection | Excel Discussion (Misc queries) | |||
How to create a selection list then display the selection in a cell | Excel Programming | |||
Change from Column Selection to Cell Selection | Excel Programming | |||
limit cell list selection based on the selection of another list | Excel Worksheet Functions |