Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
dan dan is offline
external usenet poster
 
Posts: 866
Default How to determine cursor location?

Excel 2007: If a user clicks in Cell 'B4' or... 'E12' in a worksheet, is
there a function or VBA code stub where I can learn what cell they clicked?
Row is needed, row and column is preferred.

I am trying to do a table of DSUM results from a dynamically-updating
database with... 3500 rows or so. I've built a pivot table aggregating the
results of the transactions. Each pivot table row represents a Call Center
Agent and total transactions. I want to extend each row to include
transactions within a specific hour - e.g. Column D=11:00, E=12:00, F=13:00,
etc. I can query the database table to return transactions per a specific
agent for a specific hour

I have the data table and the pivot table of total transactions per agent
working. I do not want to build the table of 55 agents x 24 hours (implying
55 x 24 x 2 criteria), as the agents change day-to-day and hour-to-hour based
on shift. My vision is for the user to click on an agent name, and the
spreadsheet updates the transactions per hour graph of the agent selected.

If I know which cell a user chooses, I only need to build 24 x 2 criteria
for 24 DSUM updates.

Any thoughts?

--Dan
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default How to determine cursor location?

If your plan is to have the user click on a cell, then run macro, could you
use..
xRow = ActiveCell.Row
xColumn = ActiveCell.Column

in VBA, if that wasn't clear.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Dan" wrote:

Excel 2007: If a user clicks in Cell 'B4' or... 'E12' in a worksheet, is
there a function or VBA code stub where I can learn what cell they clicked?
Row is needed, row and column is preferred.

I am trying to do a table of DSUM results from a dynamically-updating
database with... 3500 rows or so. I've built a pivot table aggregating the
results of the transactions. Each pivot table row represents a Call Center
Agent and total transactions. I want to extend each row to include
transactions within a specific hour - e.g. Column D=11:00, E=12:00, F=13:00,
etc. I can query the database table to return transactions per a specific
agent for a specific hour

I have the data table and the pivot table of total transactions per agent
working. I do not want to build the table of 55 agents x 24 hours (implying
55 x 24 x 2 criteria), as the agents change day-to-day and hour-to-hour based
on shift. My vision is for the user to click on an agent name, and the
spreadsheet updates the transactions per hour graph of the agent selected.

If I know which cell a user chooses, I only need to build 24 x 2 criteria
for 24 DSUM updates.

Any thoughts?

--Dan

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default How to determine cursor location?

Sub sonic()
MsgBox (ActiveCell.Address)
End Sub

--
Gary''s Student - gsnu200838


"Dan" wrote:

Excel 2007: If a user clicks in Cell 'B4' or... 'E12' in a worksheet, is
there a function or VBA code stub where I can learn what cell they clicked?
Row is needed, row and column is preferred.

I am trying to do a table of DSUM results from a dynamically-updating
database with... 3500 rows or so. I've built a pivot table aggregating the
results of the transactions. Each pivot table row represents a Call Center
Agent and total transactions. I want to extend each row to include
transactions within a specific hour - e.g. Column D=11:00, E=12:00, F=13:00,
etc. I can query the database table to return transactions per a specific
agent for a specific hour

I have the data table and the pivot table of total transactions per agent
working. I do not want to build the table of 55 agents x 24 hours (implying
55 x 24 x 2 criteria), as the agents change day-to-day and hour-to-hour based
on shift. My vision is for the user to click on an agent name, and the
spreadsheet updates the transactions per hour graph of the agent selected.

If I know which cell a user chooses, I only need to build 24 x 2 criteria
for 24 DSUM updates.

Any thoughts?

--Dan

  #4   Report Post  
Posted to microsoft.public.excel.misc
dan dan is offline
external usenet poster
 
Posts: 866
Default How to determine cursor location?

I would like the value of a cell (ex: A1) to change based on which row the
user clicks on.

So... if the user clicks on 'B6', the value of A1 would change to '6' or 'B6'.
I will then use the value of A1 in other cells to construct criteria for a
DSUM.

Hope this helps clarify.

--Dan

"Dan" wrote:

Excel 2007: If a user clicks in Cell 'B4' or... 'E12' in a worksheet, is
there a function or VBA code stub where I can learn what cell they clicked?
Row is needed, row and column is preferred.

I am trying to do a table of DSUM results from a dynamically-updating
database with... 3500 rows or so. I've built a pivot table aggregating the
results of the transactions. Each pivot table row represents a Call Center
Agent and total transactions. I want to extend each row to include
transactions within a specific hour - e.g. Column D=11:00, E=12:00, F=13:00,
etc. I can query the database table to return transactions per a specific
agent for a specific hour

I have the data table and the pivot table of total transactions per agent
working. I do not want to build the table of 55 agents x 24 hours (implying
55 x 24 x 2 criteria), as the agents change day-to-day and hour-to-hour based
on shift. My vision is for the user to click on an agent name, and the
spreadsheet updates the transactions per hour graph of the agent selected.

If I know which cell a user chooses, I only need to build 24 x 2 criteria
for 24 DSUM updates.

Any thoughts?

--Dan

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default How to determine cursor location?

Put the following event code in the worksheet code area:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A1").Value = ActiveCell.Address
End Sub


Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm


--
Gary''s Student - gsnu200838


"Dan" wrote:

I would like the value of a cell (ex: A1) to change based on which row the
user clicks on.

So... if the user clicks on 'B6', the value of A1 would change to '6' or 'B6'.
I will then use the value of A1 in other cells to construct criteria for a
DSUM.

Hope this helps clarify.

--Dan

"Dan" wrote:

Excel 2007: If a user clicks in Cell 'B4' or... 'E12' in a worksheet, is
there a function or VBA code stub where I can learn what cell they clicked?
Row is needed, row and column is preferred.

I am trying to do a table of DSUM results from a dynamically-updating
database with... 3500 rows or so. I've built a pivot table aggregating the
results of the transactions. Each pivot table row represents a Call Center
Agent and total transactions. I want to extend each row to include
transactions within a specific hour - e.g. Column D=11:00, E=12:00, F=13:00,
etc. I can query the database table to return transactions per a specific
agent for a specific hour

I have the data table and the pivot table of total transactions per agent
working. I do not want to build the table of 55 agents x 24 hours (implying
55 x 24 x 2 criteria), as the agents change day-to-day and hour-to-hour based
on shift. My vision is for the user to click on an agent name, and the
spreadsheet updates the transactions per hour graph of the agent selected.

If I know which cell a user chooses, I only need to build 24 x 2 criteria
for 24 DSUM updates.

Any thoughts?

--Dan

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine the cell location? Eric Excel Worksheet Functions 2 March 6th 09 03:51 AM
Tracking cursor location JonStein Excel Worksheet Functions 1 May 6th 08 03:34 AM
Function for cursor location sandyboy Excel Worksheet Functions 8 March 28th 07 01:18 PM
Cursor location between grouped worksheets woodyjenk Excel Discussion (Misc queries) 0 November 14th 06 07:16 PM
Cursor Location Glen Excel Discussion (Misc queries) 2 July 21st 05 09:35 PM


All times are GMT +1. The time now is 10:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"