Posted to microsoft.public.excel.programming
|
|
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)
|