+ Reply to Thread
Results 1 to 2 of 2

How do I loop through two ranges to create a new shape?

  1. #1
    Registered User
    Join Date
    06-30-2018
    Location
    New York
    MS-Off Ver
    2013
    Posts
    2

    Question How do I loop through two ranges to create a new shape?

    Good morning!

    Please allow me to explain what I am trying to accomplish. I will do my best to be brief and to the point.

    In Excel tab "Process A" - Column A = Process Step Description (Connector, Decision, Process). Shapes will be created from these on a new tab (Circle, Diamond, Rectangle).
    Column B = The "Top" start point for each shape

    I want to review the range of cells in both rows. I would like for a new shape to be created with each loop. The shapes will be built from the following data prompts (msoShape, Left, Top, Width, Height). I will need a conditional statement to say "If the first shape in column A is a connector then AddShape(msoShapeFlowChartConnector,Left, Top, Width, Height) but if its a decision.....).
    Much of the data in the prompter are constant values. The one piece that's not is the "Top". How do I loop through Column B and get that value to fill into the data prompter with each loop? My attempts thus far have simply resulted in all the shapes being produced but stacked on top of each other. Any help you can provide will be very much appreciated as I feel like I am doing nothing more than running into a brick wall. Thank you in advance!

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: How do I loop through two ranges to create a new shape?

    I don't follow your description. Can you post your best attempted code and add comments on the part(s) that don't work? What exactly is in column B; a cell address or row number or what?
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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] how to create unprotect shape
    By 9599lorenzo in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-08-2015, 11:39 AM
  2. Create a shape, and then placed in a macro
    By ssthree in forum PowerPoint Formatting & General
    Replies: 3
    Last Post: 07-07-2014, 11:32 AM
  3. [SOLVED] Loop through ranges to create multiple charts
    By Strup in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-02-2014, 09:58 AM
  4. [SOLVED] Help to Create a Goal seek Loop for Ranges of cells
    By Invicta084 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-15-2014, 02:11 PM
  5. Shape loop recording Oleobjects
    By ericmax79 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-13-2013, 01:08 PM
  6. VBA to create specific named ranges and repeating process (Loop?) across columns
    By vinothj86 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-30-2012, 05:01 AM
  7. Selecting the shape being info'ed and setting up a loop counter
    By leaning in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-23-2011, 04:47 PM

Tags for this Thread

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