+ Reply to Thread
Results 1 to 9 of 9

Looping & Off-setting Question

  1. #1
    Registered User
    Join Date
    10-25-2018
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    12

    Question Looping & Off-setting Question

    Hi!

    I need help with looping/offsetting a single procedure to every sixth column.

    Attached is a small-scale test macro that I made to help better represent what I want it to do – so ultimately I have a working macro, I think…
    …but my life would be easier if I utilized looping and off-sets in Module 2, rather than manually Copying and Pasting each column in Module 1, hundreds of times.

    • Running Module 1:”Updates1” will complete the action I want (so it’s essentially just an example to show the actions needed).
    • Running Module 2: “looptest1” is what I need help with. It will prevent me from typing in each column hundreds of times over.

    Thank-you to whomever can help me with this. I hope I explained it clearly!

    PS - if there is a way to shorten the coding, I will not be offended. I am a novice.
    Attached Files Attached Files
    Last edited by BrooksN123; 10-25-2018 at 04:04 PM. Reason: Work Project

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,870

    Re: Looping & Off-setting Question

    Nothing attached. No upload present.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    10-25-2018
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    12

    Re: Looping & Off-setting Question

    Sorry. I think I figured out how to attach it.

    Good catch

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,192

    Re: Looping & Off-setting Question

    Hi BrooksN123

    Welcome to the forum...Play around with this...
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  5. #5
    Registered User
    Join Date
    10-25-2018
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    12

    Re: Looping & Off-setting Question

    Thanks for the quick response!

    Everything seems to be working like a charm, apart from one line:
    Please Login or Register  to view this content.

    This line draws an Automation error:
    "Run-Time error '-24147...'
    The object invoked has disconnected from its clients"

    Is there something I have to do to avoid this?

    Thanks again!
    Last edited by alansidman; 10-25-2018 at 10:07 PM.

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,870

    Re: Looping & Off-setting Question

    Code Tags Added
    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,192

    Re: Looping & Off-setting Question

    Not able to recreate your error...Try this...
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    10-25-2018
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    12

    Re: Looping & Off-setting Question

    This actually ended up being the solution.
    Thank-you so much, sintek!

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,192

    Re: Looping & Off-setting Question

    ........................................
    Thanks.gif

+ 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. finding/setting number of row & looping through each cell in a row
    By Lconner in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2015, 08:45 PM
  2. [SOLVED] Setting values based on two criteria without looping
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-15-2015, 09:00 PM
  3. Looping Question
    By everettjsj2 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 05-19-2011, 03:35 PM
  4. Looping through cells setting a formula
    By JonPugh in forum Excel General
    Replies: 1
    Last Post: 01-08-2010, 12:04 PM
  5. Looping question
    By shak1 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-02-2009, 09:18 AM
  6. [SOLVED] Looping Question
    By Lee in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 08-04-2006, 11:30 AM
  7. looping question
    By luke in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 06-03-2005, 09:05 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