#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Buttons

Hello, I would like to put 100 buttons or so on the top of a sheet and
would like to be able to click on anyone of them so that the action would be
to go down the same sheet or another sheet directly to where that title
appears. Can someone suggest me a way?

Thanks you

Daniel


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Buttons

I'm sure there is a better way but in case no one else responds here is what
I came up with.
You will need to know the cell location of your names. ie. if your command
button caption is set to Independance Day and that title is in cell O25 then
do below:
Add your button, right click the button, left click view code. Where the
cursor is flashing(should be Private Sub Commandbutton_Click()) type:
cells(25,15).select
Now when you click the command button named Independance Day you will taken
to cell O25.

Not the best method but it works.
HTH


"Daniel" wrote in message
...
Hello, I would like to put 100 buttons or so on the top of a sheet and
would like to be able to click on anyone of them so that the action would

be
to go down the same sheet or another sheet directly to where that title
appears. Can someone suggest me a way?

Thanks you

Daniel




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Buttons

Hi, Daniel,
This code would make buttons on the top of a sheet.
Before run this code, please be sure to add NAMES( from Insert Names.) to
the ranges where that title
appears.


'-- CODE ----------------------------------------------
Sub MakeButtons()
Dim n As Name
Dim rng As Range
Dim i As Long
For Each n In ThisWorkbook.names
On Error Resume Next
Set rng = Range(n)
If Not Err.Number < 0 Then
i = i + 1
With Sheets(1).Cells(i, 1)
With .Parent.Buttons.Add(.Left, .Top, .Width, .Height)
.Caption = n.Name
.OnAction = "'GotoRange" & Chr$(34) & rng.Parent.Name &
"!" & _
rng.Address & Chr$(34) & "'"
With .Characters(Start:=1, Length:=Len(n.Name)).Font
.Name = "Verdana"
.Size = 9
End With
End With
End With
End If
Next
Set rng = Nothing
End Sub

Sub GotoRange(ByVal Target)
Application.Goto Range(Target)
End Sub
'-------------------------------------------------------


--
Kind Regards
Colo
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Colo of 'The Road of The Cell Masters' :)

URL:http://www.interq.or.jp/sun/puremis/...astersLink.htm


/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/



"Daniel" wrote in message
...
Hello, I would like to put 100 buttons or so on the top of a sheet and
would like to be able to click on anyone of them so that the action would

be
to go down the same sheet or another sheet directly to where that title
appears. Can someone suggest me a way?

Thanks you

Daniel



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
Option Buttons/Radio Buttons John Calder New Users to Excel 7 May 16th 08 03:51 AM
Form buttons vs. ActiveX Buttons GeorgeJ Excel Discussion (Misc queries) 3 August 11th 07 09:02 PM
have toggle buttons but everytime print preview buttons move TinSandhu Excel Discussion (Misc queries) 1 October 11th 06 02:57 PM
pivot chart is it possible to hide individual field buttons? Layout Field buttons Matt Charts and Charting in Excel 0 August 27th 06 02:57 PM
Control Buttons vs. Command Buttons Robert Gibson Excel Programming 1 October 13th 03 04:33 PM


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