LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default [HELP] How to use command buttons in cycles

i've a problem in VBE (visual basic excel).

i've created a user form with more than 30 command buttons.
for each command button i've to change its field ".caption"
capturing a specific cell content.

for example:

in cells A1:A30 i've 30 different names. i've to associate :

range("A1").value to commandbutton1.caption
......
.....
range("A30").value to commandbutton30.caption

i would like to do it with a cycle (for..next, or smthg
similar).

the code i would like to writew down is:

for every commandbutton in userform1 do
commandbutton.caption=range("A1").value

the problem is i've to specify the number of command button
i'm workin' with

so the extended code i actually use is :

with userform1
commandbutton1.caption=range("A1").value
......
commandbutton30.caption=range("A30").value


i would like to substitute these 30 lines of code with a
single cycle/loop.

thanks in advance .





 
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
How do you change seconds to cycles? Eric Excel Worksheet Functions 2 March 1st 10 10:36 PM
Command Buttons msals22 Excel Discussion (Misc queries) 1 June 22nd 06 01:33 AM
Excell freezez after many macro cycles. Vector Excel Discussion (Misc queries) 0 January 11th 06 05:39 AM
command buttons Natalie Excel Worksheet Functions 1 March 7th 05 01:45 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 08:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"