Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Get address of cell clicked

I want to write a macro that documents the address of the
cell that is clicked, NOT the active cell.

Example:
With A5 active, you invoke the macro.
The macro asks "What cell do you want to document?"
The user then clicks, say, A1.
The macro then enters this in A5: =cell("address",a1)&cell
("filename",a1)

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Get address of cell clicked

Terry,

Look at Application.InputBox (with a Type of 8) in Help.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Terry" wrote in message
...
I want to write a macro that documents the address of the
cell that is clicked, NOT the active cell.

Example:
With A5 active, you invoke the macro.
The macro asks "What cell do you want to document?"
The user then clicks, say, A1.
The macro then enters this in A5: =cell("address",a1)&cell
("filename",a1)

Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Get address of cell clicked

Terry,

Use something like

ActiveCell.Formula = "=CELL(""address""," & MyCell.Address & ")"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Terry" wrote in message
...
OK, now I've got:

Set MyCell = Application.InputBox(prompt:="Select cell
to document", Type:=8)

But how do I use this variable? If I use:

ActiveCell.Formula = "=cell(""address"",MyCell)"

... my result is #NAME? because "MyCell" isn't a valid
rangename in the worksheet.



-----Original Message-----
Terry,

Look at Application.InputBox (with a Type of 8) in Help.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Terry" wrote in message
...
I want to write a macro that documents the address of

the
cell that is clicked, NOT the active cell.

Example:
With A5 active, you invoke the macro.
The macro asks "What cell do you want to document?"
The user then clicks, say, A1.
The macro then enters this in A5: =cell("address",a1)

&cell
("filename",a1)

Thanks!



.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Get address of cell clicked

That did it. Many thanks!
-----Original Message-----
Terry,

Use something like

ActiveCell.Formula = "=CELL(""address""," &

MyCell.Address & ")"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Terry" wrote in

message
...
OK, now I've got:

Set MyCell = Application.InputBox(prompt:="Select cell
to document", Type:=8)

But how do I use this variable? If I use:

ActiveCell.Formula = "=cell(""address"",MyCell)"

... my result is #NAME? because "MyCell" isn't a valid
rangename in the worksheet.



-----Original Message-----
Terry,

Look at Application.InputBox (with a Type of 8) in

Help.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the

Purbecks
(remove nothere from the email address if mailing

direct)

"Terry" wrote in message
...
I want to write a macro that documents the address of

the
cell that is clicked, NOT the active cell.

Example:
With A5 active, you invoke the macro.
The macro asks "What cell do you want to document?"
The user then clicks, say, A1.
The macro then enters this in A5: =cell("address",a1)

&cell
("filename",a1)

Thanks!


.



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Get address of cell clicked


"Terry" wrote in message
...
OK, now I've got:

Set MyCell = Application.InputBox(prompt:="Select cell
to document", Type:=8)

But how do I use this variable? If I use:

ActiveCell.Formula = "=cell(""address"",MyCell)"

... my result is #NAME? because "MyCell" isn't a valid
rangename in the worksheet.


Set MyCell = Application.InputBox(prompt:="Select cell to document",
Type:=8)

ActiveCell.Formula = "=cell(""address""," & MyCell.Address & ")"


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Get address of cell clicked

Sub AA()
Dim MyRange As Object
Set MyRange = Application.InputBox(prompt:= _
"What cell do you want to document?", Title:="Select Cell",
Type:=8)
ActiveCell.Value = MyRange.Address
End Sub

This will put in your active cell (A5 in your example) the string
"$A$1". I suppose if you want it in the way you described, you can
try this:

Sub AAA()
Dim MyCell As String
Dim MyRange As Object
Set MyRange = Application.InputBox(prompt:= _
"What cell do you want to document?", Title:="Select Cell",
Type:=8)
MyCell = MyRange.Address
ActiveCell.Value = "=Cell(""address""," _
& MyCell & ") & Cell(""filename"", " & MyCell & ")"
End Sub

Regards, John




"Terry" wrote in message ...
I want to write a macro that documents the address of the
cell that is clicked, NOT the active cell.

Example:
With A5 active, you invoke the macro.
The macro asks "What cell do you want to document?"
The user then clicks, say, A1.
The macro then enters this in A5: =cell("address",a1)&cell
("filename",a1)

Thanks!

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
Change the chart when a cell is clicked SheriTingle Charts and Charting in Excel 2 April 1st 10 05:41 PM
cell is not outlined when clicked on Jaunerose Excel Discussion (Misc queries) 0 April 29th 09 08:57 PM
Drop down fill box does not appear when cell clicked. JIM - Farmington, Utah Excel Worksheet Functions 1 April 10th 09 04:38 PM
How do I insert a cell which changes value when clicked on JohnRScott Excel Discussion (Misc queries) 2 March 13th 09 04:31 AM
HOW DO I GET AN X IN A CELL IN EXCEL TO COME & GO WHEN CLICKED carbetboy Excel Discussion (Misc queries) 3 March 22nd 08 11:21 PM


All times are GMT +1. The time now is 11:29 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"