Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / March 2007

Tip: Looking for answers? Try searching our database.

Active row cell reference

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pskwaak - 18 Mar 2007 01:09 GMT
I working on a baseball scoresheet.  I want cell Q2 to read the cell contents
in column H of the active row, as I move the active cell up and down the rows
(i.e., if active cell is Y36, I want Q2 to read data in H35 (note it is
offset by one row).)

   Cells G6:G53 = players names (batting order)
   Cells H5:H52 = current data for the players, based on VLOOKUP formula,
which updates with each at-bat
   Columns K:CE = results of each at-bat as the game is played

I don't believe I can use the active cell as a reference within a formula,
so I'll probably need a VB macro....any ideas?  I saw a similar question on
this forum, but wasn't quite what I was looking for.
Harlan Grove - 18 Mar 2007 01:39 GMT
pskwaak <pskw...@discussions.microsoft.com> wrote...
>I working on a baseball scoresheet.  I want cell Q2 to read the
>cell contents in column H of the active row, as I move the active
[quoted text clipped - 4 lines]
>Cells H5:H52 = current data for the players, based on VLOOKUP
>formula, which updates with each at-bat

So if Bobby Roberts were in G6 and Tommy Thompson were in G7, Tommy's
batting average would be in the same row as Bobby's name? If so, there
may be better ways to handle layout.

Anyway, if you could live with pressing [F9] to recalcute formulas,
try the following formula in Q2.

=INDEX(H:H,CELL("Row")-1)

Otherwise, use this same formula in Q2 and add a SelectionChange event
handler like the following to the worksheet's VBA class module (right-
click on the worksheet's tab, click on View Code, then paste this
event handler into the code window).

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
 Application.EnableEvents = False
 Application.Calculate
 Application.EnableEvents = True
End Sub
pskwaak - 18 Mar 2007 02:38 GMT
Great! This is exactly what I was looking for.
For the offset data, each player's entry in column G consists of three
cells, top one for name, bottom two for additional statistics...so actually,
players' names are at every third cell in column G.  The active cell in the
rest of the scoresheet is one row below the required data row.  There may be
a better setup as I progress with this project, but your solution really
helped!
Thanks again

> pskwaak <pskw...@discussions.microsoft.com> wrote...
> >I working on a baseball scoresheet.  I want cell Q2 to read the
[quoted text clipped - 25 lines]
>   Application.EnableEvents = True
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.