+ Reply to Thread
Results 1 to 3 of 3

How to create this loop in VBA

  1. #1
    Registered User
    Join Date
    09-01-2014
    Location
    Alabama
    MS-Off Ver
    2010
    Posts
    1

    How to create this loop in VBA

    Hello, I've coded in multiple languages before, but never VBA... I'm trying to create the following nested loop. Can someone tell me how to do this in VBA?

    I have 5 values in cells B5, B6, B7, B8 and E5, and I want to perform the following calculation (in pseudo code) and return the value to cell B11:

    Please Login or Register  to view this content.
    Thanks for you help

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,570

    Re: How to create this loop in VBA

    I don't quite get what you are doing, but this will correct the looping code. I don't see where you want to loop through B5, etc.
    Please Login or Register  to view this content.
    Last edited by protonLeah; 09-01-2014 at 07:28 PM.
    Ben Van Johnson

  3. #3
    Forum Contributor
    Join Date
    07-29-2014
    Location
    Oz
    MS-Off Ver
    2010
    Posts
    142

    Re: How to create this loop in VBA

    The below translates your pseudo code. You need to allocate a value to your L variable either before or inside the loops. L=L+ something when L has no value will fire an error.
    Also, you need to replace "Sheetname" with the tab name of your worksheet that houses the cells you are looking at.
    Dan
    Please Login or Register  to view this content.
    Don't forget to ☆ me if I helped you!

+ 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] Create a loop with VBA
    By DeNam in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-09-2013, 04:20 AM
  2. How to create VBA loop?
    By bergjes in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-18-2013, 03:11 PM
  3. How to create a loop?
    By LiLi1 in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 11-20-2011, 10:58 PM
  4. How to create a Loop
    By Sahak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-08-2008, 02:49 PM
  5. How do I create a For loop within a For loop?
    By Linking to specific cells in p in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-24-2005, 06:07 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