+ Reply to Thread
Results 1 to 4 of 4

Can i make the column I want to loop a variable? (i,VARIABLE) instead of (i,2)

  1. #1
    Registered User
    Join Date
    08-26-2016
    Location
    London
    MS-Off Ver
    2010
    Posts
    26

    Can i make the column I want to loop a variable? (i,VARIABLE) instead of (i,2)

    Hello! I have gotten a bit stuck and would appreciate anyone's help!

    I have made macro which is a work assigner, it takes via an input box "x" amount of people in your team (maximum of 12) and looks at "y" amount of your tasks (could be 1000's), and decides how to assign them fairly

    However, I have hard coded each loop to put the worker's name in column 2:

    Please Login or Register  to view this content.

    Is there a way to make this a variable based on an input box? example
    cells(i,VARIABLE).value=nameofworker1

    I did try to do this myself/googled but cant make it work. The other thing with my code is it is particularly long/cumbersome, I have coded for each scenario up to 12 possible workers, but as you can see below the code is long. So long that it wont let me post the full thing here so i have only posted below up to 5 of the cases Was there a better way of doing this? Thank you for your help!



    Full code (because my work wont let me upload attachments:


    Please Login or Register  to view this content.

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Can i make the column I want to loop a variable? (i,VARIABLE) instead of (i,2)

    Hi,

    Perhaps this will suffice
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Can i make the column I want to loop a variable? (i,VARIABLE) instead of (i,2)

    Yes you can specify the column as a variable, the syntax will vary based on whether you want the column to be entered as a number or a letter:

    Number:
    Please Login or Register  to view this content.
    As a letter:
    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  4. #4
    Registered User
    Join Date
    08-26-2016
    Location
    London
    MS-Off Ver
    2010
    Posts
    26

    Re: Can i make the column I want to loop a variable? (i,VARIABLE) instead of (i,2)

    Thank you for your help guys! Good to have the more efficient method and how to make the column variable, thanks

+ 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] correctly 'wording' a for/next loop using a variable counter and variable filter
    By DBoyd121 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-14-2016, 06:13 PM
  2. [SOLVED] VB Loop different variables and stop variable to find a new variable..
    By feroguz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-14-2014, 04:54 PM
  3. Make cell reference column variable + row absolute?
    By pstein in forum Excel General
    Replies: 3
    Last Post: 06-18-2014, 03:11 AM
  4. Replies: 6
    Last Post: 12-21-2012, 08:03 AM
  5. [SOLVED] Loop to add string to bottom of a variable column
    By construct in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-07-2012, 02:17 PM
  6. Loop to Lookup Each Column and Index Variable Range of Rows
    By sienster in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-29-2011, 05:37 PM
  7. Replies: 2
    Last Post: 08-18-2009, 01:45 PM

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