Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2003 + macro | Excel Discussion (Misc queries) | |||
how to run acces 2003 macro in excell 2003 macro | Excel Discussion (Misc queries) | |||
Excel 2003 Macro | Excel Worksheet Functions | |||
Help with a Macro - Excel 2003 | Excel Worksheet Functions | |||
Excel 2003 macro | Excel Programming |