+ Reply to Thread
Results 1 to 4 of 4

VBA loops

  1. #1
    Registered User
    Join Date
    12-05-2012
    Location
    victoria
    MS-Off Ver
    Excel 2010
    Posts
    55

    VBA loops

    Hello,

    I am just wondering what the proper syntax is for looping through multiple items such as shapes:

    what I am trying to do is conditional formatting to change the color of a circle but I don't want to do it for each shape individually.

    Please Login or Register  to view this content.

    each of my ovals are number from "oval_1" to "oval_10"

    thanks.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: VBA loops

    There are various ways to do loop through a collection like shapes and which you use kind of depends on what you are trying to do.

    In your example the psuedo code you've posted is almost right.

    The 'real' code might look something like this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    12-05-2012
    Location
    victoria
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: VBA loops

    great thanks,

    would the one line need to be:

    Please Login or Register  to view this content.
    since the oval name is "oval_1"

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: VBA loops

    Not sure what you mean.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] For next loops
    By Boblincs in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-06-2013, 01:49 PM
  2. [SOLVED] Help with do until loops.
    By etuckram in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-28-2013, 08:15 AM
  3. Using loops in VBA
    By reefswaggie in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 05-11-2012, 02:28 PM
  4. [SOLVED] For next loops
    By Kate in forum Excel General
    Replies: 5
    Last Post: 05-22-2006, 08:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1