+ Reply to Thread
Results 1 to 1 of 1

problem with generating new worksheet in macro and transferring values

  1. #1
    Registered User
    Join Date
    07-29-2012
    Location
    melbourne
    MS-Off Ver
    Excel 2007
    Posts
    1

    problem with generating new worksheet in macro and transferring values

    i am attempting to make a betting sheet to calculate the returns of betting combinations. in particular the 'super heinz'. Have looked online for about 6 hours for a pre made one to no avail. want to be able to edit in progress so if i lose a leg i can recalculate my return.

    The problem that i'm having is that i want the final return value returned to my first sheet. I am running 'list permutation' macro that generates my values to a new worksheet. Each time i run the macro the worksheet number goes up (worksheet 18, worksheet 19, etc). so when i attempt to run the macro, it runs into the wall of trying to pull a value from a sheet that doesn't exist because the number has been superseeded.

    I want to be able to click the sheet, rename it and then pull the figure from that correct sheet. I have 8 sheets that i need to generate values on. Is there a way of getting the macro to follow "worksheet 1$"? This is what i've tried and its moved to a new error but this error is before the sheet change problem.


    This is the new error coming up after the error box says "cant execute code in break mode":
    ActiveCell.FormulaR1C1 = "=SUM(R[-4]C[-2]:R[3]C[-2])"

    This is the first phase of the macro i'm trying to get to run:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This is my first post in this forum but i found the list permutation sub here so heaps of thanks already!!!!!

    PS.
    I screwed up my save and lost the macro. I have just re-pasted the code back into VBA but now its coming up with data error. nothing has changed from yesterday except that the macro is now called "sheet11.ListPermutations"
    I think i'll fiddle with it and see what happens

    Cheers

    PPS.
    new problem the above data error is no longer happening but i am now getting Compile Error: Sub or Function not defined.
    The entire code is below and the error highlighted
    Please Login or Register  to view this content.
    Last edited by benniboi; 07-30-2012 at 06:30 AM. Reason: additional problem

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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