Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default For each control in sheet

Hi

I would like to adress all controlelements in my worksheet one by one using
the "For Each"- statement, but i can't get it working.

Dim i As Controls
For Each i In Worksheets("Sheet1")
MsgBox i.Name
Next

Hoping for help

Claus


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default For each control in sheet

Hi Claus,

try something like this:

for each oleobject in worksheets("Sheet1").oleobjects

Regards,
Ivan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default For each control in sheet

Dim i As Long

For i = 1 To ActiveSheet.OLEObjects.Count
MsgBox ActiveSheet.OLEObjects(i).Name
Next i


--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"Claus" wrote in message
...
Hi

I would like to adress all controlelements in my worksheet one by one

using
the "For Each"- statement, but i can't get it working.

Dim i As Controls
For Each i In Worksheets("Sheet1")
MsgBox i.Name
Next

Hoping for help

Claus




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default For each control in sheet

Hi Ivan

Thank you, it works ;-)

Claus

"Ivan Raiminius" skrev i en meddelelse
oups.com...
Hi Claus,

try something like this:

for each oleobject in worksheets("Sheet1").oleobjects

Regards,
Ivan



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
Control in Chart Sheet Anderflash Charts and Charting in Excel 6 June 7th 07 10:26 PM
Control Sheet Cedrun Excel Worksheet Functions 2 October 4th 06 09:48 PM
Control on Sheet - Drop Down 1 Arturo Excel Programming 2 April 25th 05 04:42 PM
Control End After the Sheet is Modified Paul Excel Discussion (Misc queries) 3 February 18th 05 05:12 PM


All times are GMT +1. The time now is 04:24 PM.

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"