Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default Select more than on CommandButton

Hi all, I am trying to select all ComandButtons from 1 to 9 and I
wrote this code (see below) to do this job but I am getting error.
Please can any friend can help that what am I doing wrong.

Private Sub Image1_Click()
Dim i As Integer
For i = 1 To 9
Me.CommandButton&(i).Select
Next
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Select more than on CommandButton

On Jan 19, 11:51*am, K wrote:
Hi all, *I am trying to select all ComandButtons from 1 to 9 and I
wrote this code (see below) to do this job but I am getting error.
Please can any friend can help that what am I doing wrong.

Private Sub Image1_Click()
Dim i As Integer
For i = 1 To 9
Me.CommandButton&(i).Select
Next
End Sub


Hi,
Have a go with
Me.Controls("CommandButton" & i).Select

Cheers
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default Select more than on CommandButton

On Jan 19, 11:20*am, Carim wrote:
On Jan 19, 11:51*am, K wrote:

Hi all, *I am trying to select all ComandButtons from 1 to 9 and I
wrote this code (see below) to do this job but I am getting error.
Please can any friend can help that what am I doing wrong.


Private Sub Image1_Click()
Dim i As Integer
For i = 1 To 9
Me.CommandButton&(i).Select
Next
End Sub


Hi,
Have a go with
Me.Controls("CommandButton" & i).Select

Cheers


Hi carim, Thanks for replying. I did try your code but I am still
getting error. Have you got any other suggestions
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Select more than on CommandButton

Where are your CommandButtons located... on the worksheet or on a UserForm?
If on the worksheet, which toolbar did you get them from... Forms or
Controls Toolbox?

--
Rick (MVP - Excel)


"K" wrote in message
...
On Jan 19, 11:20 am, Carim wrote:
On Jan 19, 11:51 am, K wrote:

Hi all, I am trying to select all ComandButtons from 1 to 9 and I
wrote this code (see below) to do this job but I am getting error.
Please can any friend can help that what am I doing wrong.


Private Sub Image1_Click()
Dim i As Integer
For i = 1 To 9
Me.CommandButton&(i).Select
Next
End Sub


Hi,
Have a go with
Me.Controls("CommandButton" & i).Select

Cheers


Hi carim, Thanks for replying. I did try your code but I am still
getting error. Have you got any other suggestions

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default Select more than on CommandButton

On Jan 19, 3:03*pm, "Rick Rothstein"
wrote:
Where are your CommandButtons located... on the worksheet or on a UserForm?
If on the worksheet, which toolbar did you get them from... Forms or
Controls Toolbox?

--
Rick (MVP - Excel)

"K" wrote in message

...
On Jan 19, 11:20 am, Carim wrote:





On Jan 19, 11:51 am, K wrote:


Hi all, I am trying to select all ComandButtons from 1 to 9 and I
wrote this code (see below) to do this job but I am getting error.
Please can any friend can help that what am I doing wrong.


Private Sub Image1_Click()
Dim i As Integer
For i = 1 To 9
Me.CommandButton&(i).Select
Next
End Sub


Hi,
Have a go with
Me.Controls("CommandButton" & i).Select


Cheers


Hi carim, *Thanks for replying. *I did try your code but I am still
getting error. *Have you got any other suggestions- Hide quoted text -

- Show quoted text -


Hi Rick, Thanks for replying. Please see my question which I posted
again to explain what actually I need in link below.
http://groups.google.com/group/micro...37a3e671e0cee5
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
Using a variable to select a CommandButton and setting the caption PCLIVE Excel Programming 4 October 21st 08 06:22 PM
Ref Commandbutton WLMPilot Excel Programming 0 February 20th 08 02:51 PM
commandbutton? Bobbykm Excel Programming 3 September 30th 07 01:13 AM
CommandButton Alvin Hansen[_2_] Excel Programming 3 August 16th 04 06:35 PM
CommandButton chris[_12_] Excel Programming 1 April 15th 04 01:01 AM


All times are GMT +1. The time now is 08:42 PM.

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"