Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
I have a For each cycle, like this: For Each ecell In erng Next ecell I can't figure out how to determine row and column indices of ECELL inside the cycle. I mean that I'd like to know for example, that the current ECELL is in the 3rd row and 2nd column of ERNG. Please help! Thanks, Stefi |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I found a solution:
ERNG.Row - ECELL.Row + 1 ERNG.Column - ECELL.Column + 1 Is this the best solution? Stefi €˛Stefi€¯ ezt Ć*rta: Hi All, I have a For each cycle, like this: For Each ecell In erng Next ecell I can't figure out how to determine row and column indices of ECELL inside the cycle. I mean that I'd like to know for example, that the current ECELL is in the 3rd row and 2nd column of ERNG. Please help! Thanks, Stefi |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That's the right way to do assuming that erng may not always start in row 1
and/or column 1. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Stefi" wrote in message ... I found a solution: ERNG.Row - ECELL.Row + 1 ERNG.Column - ECELL.Column + 1 Is this the best solution? Stefi "Stefi" ezt ķrta: Hi All, I have a For each cycle, like this: For Each ecell In erng Next ecell I can't figure out how to determine row and column indices of ECELL inside the cycle. I mean that I'd like to know for example, that the current ECELL is in the 3rd row and 2nd column of ERNG. Please help! Thanks, Stefi |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Bob for confirming my solution! What about my correction?
Stefi €˛Bob Phillips€¯ ezt Ć*rta: That's the right way to do assuming that erng may not always start in row 1 and/or column 1. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Stefi" wrote in message ... I found a solution: ERNG.Row - ECELL.Row + 1 ERNG.Column - ECELL.Column + 1 Is this the best solution? Stefi "Stefi" ezt Ć*rta: Hi All, I have a For each cycle, like this: For Each ecell In erng Next ecell I can't figure out how to determine row and column indices of ECELL inside the cycle. I mean that I'd like to know for example, that the current ECELL is in the 3rd row and 2nd column of ERNG. Please help! Thanks, Stefi |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I assumed the error and read it as corrected.
-- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Stefi" wrote in message ... Thanks Bob for confirming my solution! What about my correction? Stefi "Bob Phillips" ezt ķrta: That's the right way to do assuming that erng may not always start in row 1 and/or column 1. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Stefi" wrote in message ... I found a solution: ERNG.Row - ECELL.Row + 1 ERNG.Column - ECELL.Column + 1 Is this the best solution? Stefi "Stefi" ezt ķrta: Hi All, I have a For each cycle, like this: For Each ecell In erng Next ecell I can't figure out how to determine row and column indices of ECELL inside the cycle. I mean that I'd like to know for example, that the current ECELL is in the 3rd row and 2nd column of ERNG. Please help! Thanks, Stefi |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Stefi,
So you have one way, or Debug.Print ECell.Address(False, False, xlR1C1, , Range("B4:D5").Cells(1)) NickHK "Stefi" wrote in message ... I found a solution: ERNG.Row - ECELL.Row + 1 ERNG.Column - ECELL.Column + 1 Is this the best solution? Stefi "Stefi" ezt ķrta: Hi All, I have a For each cycle, like this: For Each ecell In erng Next ecell I can't figure out how to determine row and column indices of ECELL inside the cycle. I mean that I'd like to know for example, that the current ECELL is in the 3rd row and 2nd column of ERNG. Please help! Thanks, Stefi |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Nick,
I tried this way as well (I supposed that Range("B4:D5") should be substituted with my range ERNG) but it returned the string "RC", I couldn't find out why. Stefi €˛NickHK€¯ ezt Ć*rta: Stefi, So you have one way, or Debug.Print ECell.Address(False, False, xlR1C1, , Range("B4:D5").Cells(1)) NickHK "Stefi" wrote in message ... I found a solution: ERNG.Row - ECELL.Row + 1 ERNG.Column - ECELL.Column + 1 Is this the best solution? Stefi "Stefi" ezt Ć*rta: Hi All, I have a For each cycle, like this: For Each ecell In erng Next ecell I can't figure out how to determine row and column indices of ECELL inside the cycle. I mean that I'd like to know for example, that the current ECELL is in the 3rd row and 2nd column of ERNG. Please help! Thanks, Stefi |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, of course
ECELL.Row - ERNG.Row + 1 ECELL.Column - ERNG.Column + 1 Stefi €˛Stefi€¯ ezt Ć*rta: I found a solution: ERNG.Row - ECELL.Row + 1 ERNG.Column - ECELL.Column + 1 Is this the best solution? Stefi €˛Stefi€¯ ezt Ć*rta: Hi All, I have a For each cycle, like this: For Each ecell In erng Next ecell I can't figure out how to determine row and column indices of ECELL inside the cycle. I mean that I'd like to know for example, that the current ECELL is in the 3rd row and 2nd column of ERNG. Please help! Thanks, Stefi |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try...
Range(erng(1), ecell).Rows.Count Range(erng(1), ecell).Columns.Count Ken Johnson |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Better still Stefi, don't bother with mine, yours works fine.
Ken Johnson |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Ken, nonetheless I tried Your way, too, it works fine, but I'm still
working hard to understand its logic, I like to learn new techniques. Stefi €˛Ken Johnson€¯ ezt Ć*rta: Better still Stefi, don't bother with mine, yours works fine. Ken Johnson |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jul 3, 10:14 pm, Stefi wrote:
Thanks Ken, nonetheless I tried Your way, too, it works fine, but I'm still working hard to understand its logic, I like to learn new techniques. Stefi ,,Ken Johnson" ezt ķrta: Better still Stefi, don't bother with mine, yours works fine. Ken Johnson Hi Stefi, erng(1) is the top-left cell of erng. Range(erng(1), ecell) is a range with erng(1) the top-left cell and ecell the bottom-right cell. So, it's then a matter of counting the rows and columns in Range(erng(1), ecell) to get ecell's row and column index within that range. I think your way is better because it doesn't use the Count function. Ken Johnson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Returning multiple indices for a lookup | Excel Worksheet Functions | |||
inserting a named range into new cells based on a named cell | Excel Discussion (Misc queries) | |||
Indices - Agreed Standards? | New Users to Excel | |||
Multiple Combo Box Indices? | Excel Programming | |||
If any cell in named range = 8 then shade named range | Excel Programming |