+ Reply to Thread
Results 1 to 2 of 2

Formula syntax with Variables and multiple sheets.

  1. #1
    Registered User
    Join Date
    06-01-2013
    Location
    United States
    MS-Off Ver
    Excel 2011
    Posts
    64

    Formula syntax with Variables and multiple sheets.

    Goal: perform calculations using values on another sheet. This formula (for the calculation) needs to match the destination formatting so when I paste the formula into a cell that is one to the right, the formula will update to target the cell that is one to the right on the other sheet. This formula involves the variable "n" (publicly declared elsewhere).


    This line is my issue:
    activecell.value = "=Rwt * R!Range("B2").offset(0,n+1) + Vwt * V!B2 + Cwt * C!B2

    I don't understand some basic VBA and this sort of says what I want it to do, but excel doesn't like how I entered it...so syntax-y sort of issues here.
    I'd appreciate any help. Thanks, and if you have any questions let me know, it's important I figure this out so I can be as accommodating as possible.

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    06-17-2013
    Location
    Denver
    MS-Off Ver
    2010
    Posts
    2

    Re: Formula syntax with Variables and multiple sheets.

    Well I have looked at your code, and found that you have an infinite loop in your first do-loop, if you examine closely you will see that the ActiveCell.column is constantly advancing while the n+2 is not.

    In any case here is my take on what you are trying to achieve, it will advance to the next row and so on and forth until it finds an empty ActiveCell in the GeneralRank Worksheet.

    Please Login or Register  to view this content.
    As you can see I have modified the conditions, and the way they advance somewhat, I believe without further details that this is what you are looking for.

    In any case this should be enough to get some dirt under your feet and help you find the solution. If not then you need to provide further details, exact algorithm of what you intend to do and if possible how you define the values used in this function as well as some initial test values as well as expected values.

    Regards,
    Jaime Diaz

    ---------------------------------------------------------------------------------------
    If you found this answer usefull please press the star below
    Last edited by charrod; 06-17-2013 at 03:04 PM.

+ 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