+ Reply to Thread
Results 1 to 10 of 10

Creating and setting repeating objects

  1. #1
    Registered User
    Join Date
    02-20-2014
    Location
    LA
    MS-Off Ver
    Excel 2013
    Posts
    27

    Creating and setting repeating objects

    Hello,

    Apologies in advance, as this explanation might sound a bit odd...would anyone know how to set a cell as an object for "x" amount of times?

    For example, let's say I have a userform value of "4." Based on this value, cell A10 will be set as the first object, then A20 will be the second object, then A30 will be the third object. So something like...

    Please Login or Register  to view this content.
    Many thanks!

  2. #2
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383

    Re: Creating and setting repeating objects

    What about:

    Please Login or Register  to view this content.
    !If all your troubles are solved, then so is the thread. Show this by marking it so using thread tools at the top of the page.
    If I helped do this, then please show your appreciation by awarding rep points.
    <------ Button for that is over there

  3. #3
    Registered User
    Join Date
    02-20-2014
    Location
    LA
    MS-Off Ver
    Excel 2013
    Posts
    27

    Re: Creating and setting repeating objects

    Hello, and thanks for the quick reply but I'm getting a "constant expression required" error at the Spot(i). However, intuitively, your script very much explains what I'm trying to do, and explains it much better than I did.

    Thanks again, and hope you can help.

  4. #4
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383

    Re: Creating and setting repeating objects

    Ahh of course!

    What about:

    Please Login or Register  to view this content.
    I'm being slightly experimental here...

  5. #5
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Creating and setting repeating objects

    You need to move the declaration out of the loop:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    02-20-2014
    Location
    LA
    MS-Off Ver
    Excel 2013
    Posts
    27

    Re: Creating and setting repeating objects

    Hi guys,

    I had to ReDim, as Kyle123 mentioned. But, when I try to go to the cell, spot(i), it always goes to cell B1, which is really odd. Any ideas?

    Thanks!
    Last edited by keineko; 05-05-2015 at 05:30 PM. Reason: small edit, changed cell B2 to B1

  7. #7
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Creating and setting repeating objects

    when I try to go to the cell, spot(i), it always goes to cell B1
    What does that mean? The code doesn't "go" anywhere?

  8. #8
    Registered User
    Join Date
    02-20-2014
    Location
    LA
    MS-Off Ver
    Excel 2013
    Posts
    27

    Re: Creating and setting repeating objects

    Sorry about the late response and wording ambiguity. I meant that when I try to find the object, it only goes to cell B1.

    For example,

    Please Login or Register  to view this content.
    It'll be the same for any Spot(i)...perhaps I'm using this incorrectly though...

  9. #9
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Creating and setting repeating objects

    What's spot2, what are you actually trying to do? Search the worksheet for a list of values?

  10. #10
    Registered User
    Join Date
    02-20-2014
    Location
    LA
    MS-Off Ver
    Excel 2013
    Posts
    27

    Re: Creating and setting repeating objects

    Hello,

    I guess it's sort of an odd process I'm trying to do...basically, I want to set the value of a range as an object. So there will be some text in cell A10, and that will be set as object "spot1." So everytime I'm referencing "spot1," my code knows I'm referring to the value in the text in A10. The text will be vary depending on some processes I'm running. So for example:

    Please Login or Register  to view this content.

+ 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. Setting repeating pages in a worksheet
    By Weiwennn in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-17-2014, 04:49 AM
  2. Replies: 3
    Last Post: 05-31-2012, 03:56 PM
  3. Repeating rows based on parameter setting
    By rowlandrat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2011, 04:48 AM
  4. creating a repeating formula that doesn't show repeating values
    By cybershot in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 12-09-2010, 06:12 PM
  5. [SOLVED] change the default setting of the line of objects. .75 to 2.
    By Tom Pag in forum Excel General
    Replies: 0
    Last Post: 12-19-2005, 02:35 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