+ Reply to Thread
Results 1 to 5 of 5

Single Loop or Double?

  1. #1
    Registered User
    Join Date
    10-03-2017
    Location
    Australia, Sydney
    MS-Off Ver
    2016
    Posts
    4

    Single Loop or Double?

    Hi, in the attached excel spreadsheet I'm trying to generate a multiplication table with Macro to auto generate the cells in between the rows and columns but I can't seem to make the macro update for all cases (in the row). For instance, If instead I had integers 1-10 going from cells B5 to B15 instead of 1-5 from B5 to B10, I can't make the multiplication table also update to the 10th row as C10 to F14 are empty. One idea I had was to use nested for loops but I had no luck with that and it kept screwing up. Also I know that cells C5 to F5 are inputted well before the macro coding and this was intentional to allow macros to just copy down until the number of rows (which I want to know how to do). How do I make it so that no matter what I update cell B2 with it auto updates everytime macro is run.

    Thanks
    Attached Files Attached Files
    Last edited by selsunblue; 10-05-2017 at 11:15 AM. Reason: changing title

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Macro VBA help

    Hello selsunblue & Welcome to the Forum,

    Administrative Note:
    • We would love to continue to help you with your query, but first, before we can proceed…
    • Please see Forum Rule #1 about proper thread titles and adjust accordingly...
    HTH
    Regards, Jeff

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro VBA help

    Hi selsunblue,

    Click on the "Edit" on your first post and then on Go Advanced to change your thread title to "Single Loop or Double?" Then look at the attached.

    DoubleLoop Mult Table.xlsm
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    10-03-2017
    Location
    Australia, Sydney
    MS-Off Ver
    2016
    Posts
    4

    Re: Single Loop or Double?

    Hi, Marvin

    Is there a way to do it with what I have set up before the macro is run?. Because for what I'm trying to do my columns are fixed and only the row numbers change. I'm also required to copy down the first row of results down to the maximum number of rows.

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Single Loop or Double?

    Hi selsunblue,

    Sounds like a homework problem? Keep studying.. What grade do I get? If you don't want to vary the columns then set it equal to a number in the code. Give me a grade by clicking on the "* Add Reputation" below this post.

    DoubleLoop Mult Table 2.xlsm

+ 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] Macro to add another Macro to a button to add into a larger Macro.
    By taylorsm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-03-2016, 10:51 AM
  2. [SOLVED] Define variable in macro than calling that macro inside another macro
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-21-2015, 10:58 AM
  3. Using a macro on workbook1 to create a button in wb2 and assigning macro "wb2!macro"
    By penfold1992 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-13-2014, 11:39 AM
  4. [SOLVED] Macro to show Which macro didnt work in a nested macro
    By akhileshgs in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-10-2013, 03:21 AM
  5. Perform macro "on open" specific file- store macro in Personal Macro Workbook?
    By thompssc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2012, 12:38 PM
  6. lookup macro, solver macro, realtime macro
    By xelhelp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2011, 06:14 PM
  7. Cannot find macro error when running a macro from a macro in a diffrent workbook.
    By Acrobatic82 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2010, 09:22 AM

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