Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 367
Default CAN I ADD CONTROLX BUTTON TO CUSTOMISED TOOLBARS

I AM TRYING TO CREATE A CUSTOMISED TOOLBARS HOLDING SOME CONTROL X COMMAND
BUTTONS. EG OF HOW THE BUTTON WORKS AS FOLLOWS :

WHEN I CLICK ON THE BUTTON AND HOLD ON TO THE BUTTON, IT WILL CONTINUOUSLY
MOVE THE SELECTED OBJECT SAY A DRAWN RECTANGLE ON A WORKSHEET TO THE LEFT AND
WILL STOP MOVING ONCE I RELEASE THE BUTTON.

I NEED THE BUTTON ON THE TOOLBAR TO BE CONTROL X COS I NEED THE MOUSE CLICK
MOUSE UP EVENTS TO PROGRAM THE ABOVE.

THE REASON WHY I DON USE THE COMMAND BUTTON ON THE WORKSHEET IS BECAUSE WHEN
I SCROLL DOWN THE WINDOW THE COMMAND BUTTON WILL BE OUT OF VIEW. SO I NEED
THE BUTTON TO BE AT THE TOOLBARS SO THAT WHEN I SCROLL TO ANY PORTION OF THE
WORKSHEET, THE COMMAND BUTTION REMAIN IN THE SAME PLACE WHERE I CAN EASILY
ACCESS IT.

OR ANYONE KNOW OF HOW TO STATION A COMMAND BUTTON ON A WORKSHEET AT A
LOCATION SO THAT IT WONT MOVE OUT OF VIEW WHEN I SCROLL THE WINDOW?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default CAN I ADD CONTROLX BUTTON TO CUSTOMISED TOOLBARS

This is already supported by the arrow keys.

FYI, for continued execution of a macro, I would take advantage of the fact
that assigning a macro to a keyboard key allows repeated execution while the
key is held down. A macro is continually executed the same way holding down
the "a" key produces a long string of a's ("aaaaaaaaaaaaaa").

I would create the toolbar programmatically on open (which I always do) and
assign the "TogRemap" macro to the desired button. Assumed is that the macros
"Macro1", "Macro2" etc. are your macros. Code examples:

Sub TogRemap()
With Application.CommandBars.ActionControl
If .State = msoButtonUp Then
.State = msoButtonDown
RemapKeys
Else
.State = msoButtonUp
ResetKeys
End If
End With
End Sub

Sub RemapKeys()
With Application
.Cursor = xlNorthwestArrow
.OnKey "{UP}", "Macro1"
.OnKey "{DOWN}", "Macro2"
.OnKey "{LEFT}", "Macro3"
.OnKey "{RIGHT}", "Macro4"
End With
End Sub

Sub ResetKeys()
With Application
.Cursor = xlDefault
.OnKey "{UP}"
.OnKey "{DOWN}"
.OnKey "{LEFT}"
.OnKey "{RIGHT}"
End With
End Sub

Regards,
Greg
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default CAN I ADD CONTROLX BUTTON TO CUSTOMISED TOOLBARS

Just in case my first post wasn't clear, from what you describe, you probably
don't need any code or toolbar at all. Just use the arrow keys while the
object is selected.
My code examples were only intended for general info.

I've done the same thing you describe with photos except I select them by
simply holding the mouse pointer over the desired photo (don't like the look
of the sizing handles). However, the code that translates mouse coordinates
to excel's points that allows identification of the selected object isn't
that simple.

Greg

"JASON" wrote:

I AM TRYING TO CREATE A CUSTOMISED TOOLBARS HOLDING SOME CONTROL X COMMAND
BUTTONS. EG OF HOW THE BUTTON WORKS AS FOLLOWS :

WHEN I CLICK ON THE BUTTON AND HOLD ON TO THE BUTTON, IT WILL CONTINUOUSLY
MOVE THE SELECTED OBJECT SAY A DRAWN RECTANGLE ON A WORKSHEET TO THE LEFT AND
WILL STOP MOVING ONCE I RELEASE THE BUTTON.

I NEED THE BUTTON ON THE TOOLBAR TO BE CONTROL X COS I NEED THE MOUSE CLICK
MOUSE UP EVENTS TO PROGRAM THE ABOVE.

THE REASON WHY I DON USE THE COMMAND BUTTON ON THE WORKSHEET IS BECAUSE WHEN
I SCROLL DOWN THE WINDOW THE COMMAND BUTTON WILL BE OUT OF VIEW. SO I NEED
THE BUTTON TO BE AT THE TOOLBARS SO THAT WHEN I SCROLL TO ANY PORTION OF THE
WORKSHEET, THE COMMAND BUTTION REMAIN IN THE SAME PLACE WHERE I CAN EASILY
ACCESS IT.

OR ANYONE KNOW OF HOW TO STATION A COMMAND BUTTON ON A WORKSHEET AT A
LOCATION SO THAT IT WONT MOVE OUT OF VIEW WHEN I SCROLL THE WINDOW?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default CAN I ADD CONTROLX BUTTON TO CUSTOMISED TOOLBARS

Hi ,

How is everything going? Please feel free to let me know if you need any
assistance.

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

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
Remove Toolbars and Menus but keep print button L Weber Excel Discussion (Misc queries) 3 October 18th 07 09:51 PM
save/export custom button image for toolbars redruthann Excel Programming 1 April 15th 06 06:48 PM
customised output TUNGANA KURMA RAJU Excel Discussion (Misc queries) 1 October 22nd 05 02:04 PM
customised sheet filo666 Excel Programming 1 May 23rd 05 04:15 PM
how to enable / disable customised button on toolbar tango Excel Programming 0 October 23rd 04 12:19 AM


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