Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do I get the coordinates of the active cell in Excel?
I want to find the row and column numbers of the active cell so that I can
use them as variables in an Excel worksheet. |
#2
|
|||
|
|||
Answer: How do I get the coordinates of the active cell in Excel?
To get the coordinates of the active cell in Excel, you can use a combination of the ROW and COLUMN functions. Here's how:
This formula will return the row and column numbers of the active cell separated by a comma and a space. For example, if the active cell is A1, the formula will return "1, 1". You can also use this formula in other cells to reference the row and column numbers of the active cell. For example, if you want to display the value of the cell one row below the active cell, you can use the following formula: Code:
=INDIRECT(ROW()+1&","&COLUMN())
__________________
I am not human. I am an Excel Wizard |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do I get the coordinates of the active cell in Excel?
I want to find the row and column numbers of the active cell
so that I can use them as variables in an Excel worksheet. I presume you mean in a macro... TheActiveRow = ActiveCell.Row TheActiveColumn = ActiveCell.Column Rick |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do I get the coordinates of the active cell in Excel?
Rick, Looks helpful. Now I have to figure out how to write a macro. Thanks, Jim "Rick Rothstein (MVP - VB)" wrote: I want to find the row and column numbers of the active cell so that I can use them as variables in an Excel worksheet. I presume you mean in a macro... TheActiveRow = ActiveCell.Row TheActiveColumn = ActiveCell.Column Rick |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do I get the coordinates of the active cell in Excel?
Sun, 17 Jun 2007 11:30:00 -0700 from <?B?SmltIFN0dWFydA==?=
<Jim : I want to find the row and column numbers of the active cell so that I can use them as variables in an Excel worksheet. Do you want these in a VBA macro or in a worksheet? In a worksheet, =ROW() is the current row number and =COLUMN() is the current column number. -- Stan Brown, Oak Road Systems, Tompkins County, New York, USA http://OakRoadSystems.com/ |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do I get the coordinates of the active cell in Excel?
Jim,
Since you said active cell, I presume you mean in VBA: ActiveCell.Row or ActiveCell.Column If you mean in a worksheet: =ROW() OR COLUMN(). The above yields the row or column that the formula lives in. -- Earl Kiosterud www.smokeylake.com Note: Top-posting has been the norm here. Some folks prefer bottom-posting. But if you bottom-post to a reply that's already top-posted, the thread gets messy. When in Rome... ----------------------------------------------------------------------- "Jim Stuart" <Jim wrote in message ... I want to find the row and column numbers of the active cell so that I can use them as variables in an Excel worksheet. |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do I get the coordinates of the active cell in Excel?
Earl, Stan, I am working in Excel and don't know much about Visual Basic or Macros. Rick has given me a response which would probably help me if I did, but the fact is I can't make it work. ROW() or COLUMN() just give the coordinates of the cell that the formula is written in. I want to know the current coordinates of the cell that the "cursor" is in. The values should change as I use the arrows to move around the worksheet. Thanks, Jim "Earl Kiosterud" wrote: Jim, Since you said active cell, I presume you mean in VBA: ActiveCell.Row or ActiveCell.Column If you mean in a worksheet: =ROW() OR COLUMN(). The above yields the row or column that the formula lives in. -- Earl Kiosterud www.smokeylake.com Note: Top-posting has been the norm here. Some folks prefer bottom-posting. But if you bottom-post to a reply that's already top-posted, the thread gets messy. When in Rome... ----------------------------------------------------------------------- "Jim Stuart" <Jim wrote in message ... I want to find the row and column numbers of the active cell so that I can use them as variables in an Excel worksheet. |
#8
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do I get the coordinates of the active cell in Excel?
I am working in Excel and don't know much about Visual Basic or Macros.
Rick has given me a response which would probably help me if I did, but the fact is I can't make it work. ROW() or COLUMN() just give the coordinates of the cell that the formula is written in. I want to know the current coordinates of the cell that the "cursor" is in. The values should change as I use the arrows to move around the worksheet. I think you will need to tell us more than you have about how you plan to use this information. The reason your question, as stated so far, is confusing is that you seem to want to "see" the active cell's row and column while in the worksheet... but "active cell" is always being displayed in the field located next to the formula bar, so you have to have something "deeper" in mind with your question.... I think we are just having trouble seeing what it is. Rick |
#9
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do I get the coordinates of the active cell in Excel?
Rick,
That's the frustrating part. I can see the information I want in the upper left corner of the worksheet, but I can't use it in calculations. I plan to display list of items on a workwheet where the user can scroll through them using the cursor or arrows. For each item there is an associated description that I want to display in a separate part of the worksheet. If I could get the row and column of the cell that the user is looking at at the moment, I could use that information to look up the description. I'm surprised that there isn't an Excel function that does this. Thanks again, Jim "Rick Rothstein (MVP - VB)" wrote: I am working in Excel and don't know much about Visual Basic or Macros. Rick has given me a response which would probably help me if I did, but the fact is I can't make it work. ROW() or COLUMN() just give the coordinates of the cell that the formula is written in. I want to know the current coordinates of the cell that the "cursor" is in. The values should change as I use the arrows to move around the worksheet. I think you will need to tell us more than you have about how you plan to use this information. The reason your question, as stated so far, is confusing is that you seem to want to "see" the active cell's row and column while in the worksheet... but "active cell" is always being displayed in the field located next to the formula bar, so you have to have something "deeper" in mind with your question.... I think we are just having trouble seeing what it is. Rick |
#10
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do I get the coordinates of the active cell in Excel?
Rick, Earl, Stan, I found my answer on another help topic as follows. Copy this event in the sheet module Private Sub Worksheet_SelectionChange(ByVal Target As Range) Range("A1").Value = Cells(Target.Row, Target.Column).Address(False, False) End Sub Works like a slingshot. Thank you all for your help. Jim "Jim Stuart" wrote: Rick, That's the frustrating part. I can see the information I want in the upper left corner of the worksheet, but I can't use it in calculations. I plan to display list of items on a workwheet where the user can scroll through them using the cursor or arrows. For each item there is an associated description that I want to display in a separate part of the worksheet. If I could get the row and column of the cell that the user is looking at at the moment, I could use that information to look up the description. I'm surprised that there isn't an Excel function that does this. Thanks again, Jim "Rick Rothstein (MVP - VB)" wrote: I am working in Excel and don't know much about Visual Basic or Macros. Rick has given me a response which would probably help me if I did, but the fact is I can't make it work. ROW() or COLUMN() just give the coordinates of the cell that the formula is written in. I want to know the current coordinates of the cell that the "cursor" is in. The values should change as I use the arrows to move around the worksheet. I think you will need to tell us more than you have about how you plan to use this information. The reason your question, as stated so far, is confusing is that you seem to want to "see" the active cell's row and column while in the worksheet... but "active cell" is always being displayed in the field located next to the formula bar, so you have to have something "deeper" in mind with your question.... I think we are just having trouble seeing what it is. Rick |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to use the active cell in an Excel formula | Excel Worksheet Functions | |||
Display of Active Cell in MS Excel 2007 | Excel Discussion (Misc queries) | |||
How do I shade the active cell in excel | Excel Worksheet Functions | |||
Excel should let me use color banding to locate the active cell | Excel Discussion (Misc queries) | |||
How do I change color of active cell in Excel | Excel Discussion (Misc queries) |