Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Excel 2003 Macro help

Can anyone tell me how to make a macro that when the graphic is clicked on,
the macro would select the cell that graphic is locked to (not by specific
name i.e. E5), move one cell to the right, and "double-click" that cell.

I need it to specifically select the cell that that specific graphic is in
and I will have hundreds of buttons doing this, and I want to be able to make
one and copy it where needed without all of them selecting the cell that the
original is in, and I don't want to do each and every one separately.

Thanks in advance for any help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Excel 2003 Macro help


If your graphic is a Shape, then use the TopLeftCell property to select
the cell the Shape is over.
What is the reason or purpose for double-clicking the cell to the right?
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"Fishnerd"
wrote in message
Can anyone tell me how to make a macro that when the graphic is clicked on,
the macro would select the cell that graphic is locked to (not by specific
name i.e. E5), move one cell to the right, and "double-click" that cell.

I need it to specifically select the cell that that specific graphic is in
and I will have hundreds of buttons doing this, and I want to be able to make
one and copy it where needed without all of them selecting the cell that the
original is in, and I don't want to do each and every one separately.

Thanks in advance for any help
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Excel 2003 Macro help

Basically, Column D has buttons that look like miniture spanish flags.
Column E has a word in Spanish (without Wrap-text formatting active). Column
F has that same word in English. Column E's width is minimized so that the
Spanish word doesn't show. I'm trying to setup a macro on each flag button,
that when you press it, the cell to the right of that specific flag is
"double clicked" (as if you were double clicking it with the mouse), causing
just that cell with that spanish word to expand to it's full length, covering
up the English translation, and instead showing the word in Spanish.

Thanks Jim for giving me a hand with this! I've been trying to figure out
how to do it for a week now...

"Jim Cone" wrote:


If your graphic is a Shape, then use the TopLeftCell property to select
the cell the Shape is over.
What is the reason or purpose for double-clicking the cell to the right?
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Excel 2003 Macro help

A different approach...
Place your Spanish words in Column D. Place your English words in both Column E and F.
Hide Columns D and F, leaving all other columns showing.
Right click the sheet tab and choose "View Code"
Copy and paste the following code into the sheet module.
Double clicking a cell in Column C will then show the Spanish word in Column E.
Pressing enter or selecting another cell changes Spanish to English.
'------
Option Explicit

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Application.Intersect(Target, Me.Columns("C")) Is Nothing Then
Target(1, 3).Value = Target(1, 2).Value
Cancel = True
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Me.Columns("E").Value = Me.Columns("F").Value
End Sub
------
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Fishnerd"
wrote in message
Basically, Column D has buttons that look like miniture spanish flags.
Column E has a word in Spanish (without Wrap-text formatting active). Column
F has that same word in English. Column E's width is minimized so that the
Spanish word doesn't show. I'm trying to setup a macro on each flag button,
that when you press it, the cell to the right of that specific flag is
"double clicked" (as if you were double clicking it with the mouse), causing
just that cell with that spanish word to expand to it's full length, covering
up the English translation, and instead showing the word in Spanish.

Thanks Jim for giving me a hand with this! I've been trying to figure out
how to do it for a week now...

"Jim Cone" wrote:


If your graphic is a Shape, then use the TopLeftCell property to select
the cell the Shape is over.
What is the reason or purpose for double-clicking the cell to the right?
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Excel 2003 Macro help

NICE! I like it!
What do I do now to make clicking the miniature flags "double click" the
corresponding cell in Column C?

Thanks again Jim!

"Jim Cone" wrote:

A different approach...
Place your Spanish words in Column D. Place your English words in both Column E and F.
Hide Columns D and F, leaving all other columns showing.
Right click the sheet tab and choose "View Code"
Copy and paste the following code into the sheet module.
Double clicking a cell in Column C will then show the Spanish word in Column E.
Pressing enter or selecting another cell changes Spanish to English.
'------
Option Explicit

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Application.Intersect(Target, Me.Columns("C")) Is Nothing Then
Target(1, 3).Value = Target(1, 2).Value
Cancel = True
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Me.Columns("E").Value = Me.Columns("F").Value
End Sub
------
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Fishnerd"
wrote in message
Basically, Column D has buttons that look like miniture spanish flags.
Column E has a word in Spanish (without Wrap-text formatting active). Column
F has that same word in English. Column E's width is minimized so that the
Spanish word doesn't show. I'm trying to setup a macro on each flag button,
that when you press it, the cell to the right of that specific flag is
"double clicked" (as if you were double clicking it with the mouse), causing
just that cell with that spanish word to expand to it's full length, covering
up the English translation, and instead showing the word in Spanish.

Thanks Jim for giving me a hand with this! I've been trying to figure out
how to do it for a week now...

"Jim Cone" wrote:


If your graphic is a Shape, then use the TopLeftCell property to select
the cell the Shape is over.
What is the reason or purpose for double-clicking the cell to the right?
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Excel 2003 Macro help


My intention was to get rid of the shapes.
If you have 20,000 translations then you have to have 20,000 shapes.
That is not a good idea.
If you must then you can use this sub for all of the flag shapes...
'--
Sub What_Do_I_Do_Now()
Dim rng As Range
Set rng = ActiveSheet.Shapes(Application.Caller).TopLeftCell
rng(1, 3).Value = rng(1, 2).Value
Set rng = Nothing
End Sub
'--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Fishnerd"
wrote in message
NICE! I like it!
What do I do now to make clicking the miniature flags "double click" the
corresponding cell in Column C?
Thanks again Jim!


"Jim Cone" wrote:
A different approach...
Place your Spanish words in Column D. Place your English words in both Column E and F.
Hide Columns D and F, leaving all other columns showing.
Right click the sheet tab and choose "View Code"
Copy and paste the following code into the sheet module.
Double clicking a cell in Column C will then show the Spanish word in Column E.
Pressing enter or selecting another cell changes Spanish to English.
'------
Option Explicit

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Application.Intersect(Target, Me.Columns("C")) Is Nothing Then
Target(1, 3).Value = Target(1, 2).Value
Cancel = True
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Me.Columns("E").Value = Me.Columns("F").Value
End Sub
------
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


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
Excel 2003 + macro Neil Holden Excel Discussion (Misc queries) 4 March 15th 10 12:35 PM
how to run acces 2003 macro in excell 2003 macro gonggo Excel Discussion (Misc queries) 0 October 6th 09 11:45 AM
Excel 2003 Macro Tanisha Excel Worksheet Functions 5 August 1st 06 09:31 PM
Help with a Macro - Excel 2003 Bob Smith Excel Worksheet Functions 3 June 19th 06 06:29 PM
Excel 2003 macro Betina Andersen Excel Programming 0 December 2nd 04 07:28 AM


All times are GMT +1. The time now is 12:25 PM.

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

About Us

"It's about Microsoft Excel"