+ Reply to Thread
Results 1 to 10 of 10

full range variable....

  1. #1
    Registered User
    Join Date
    11-23-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    18

    Smile full range variable....

    how to make the full range variable...

    Please Login or Register  to view this content.
    where "num2" is a variable in a "FOR loop which keeps on incrementing.

    i am not able to keep the range part dynamic relating to my incrementing variable "num2"

    how should i do it??? please help me with this one?
    Last edited by sspandit; 01-19-2010 at 07:06 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: full range variable....

    Hi,

    If I've understood the request correctly try

    Please Login or Register  to view this content.
    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: full range variable....

    TRY
    Please Login or Register  to view this content.
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  4. #4
    Registered User
    Join Date
    11-23-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: full range variable....

    Sorry guys. both the codes dont work...
    error is as follows..


    Compile error
    Expected: list seperator or )

  5. #5
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: full range variable....

    I think what you mean is this:

    Don't use the FOR, NEXT loop but apply the formula to the range directly:

    I do not understant why the LOOKUP TABLE is shifting down (unusual, should it ?), but here's the code
    Please Login or Register  to view this content.
    Last edited by rwgrietveld; 01-19-2010 at 06:54 AM.
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  6. #6
    Registered User
    Join Date
    11-23-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: full range variable....

    I am trying on a simpler code line now... but it fails miserably in the "range area itself...

    Please Login or Register  to view this content.


    same Compile Error:
    Expected: List Seperator or )

  7. #7
    Registered User
    Join Date
    11-23-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: full range variable....

    thanks for the code YWGRIETVELD .
    i have many conditions i.e. IF command before this.... so i have to keep it dynamic. i have posted the above "MAX" worksheetfunction. i needed the dynamic range for the same purpose.

    fortunately i think i may have found the answer...

    Range("F" & NUM2) = WorksheetFunction.Max(Range("ap" & NUM2 & ":" & "aw" & NUM2))


    seems to work. i dont know why. but it seems to work. after this i will perform the MATCH command and use the index number in a VLOOKUP function for "col number option"

  8. #8
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: full range variable....

    Huu,

    One function at a time please. We work hard on your problem. Don't shift to a complete new approach till the first one is done (solved) !!

    How can
    Please Login or Register  to view this content.
    be a solution to your first problem?

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: full range variable....

    Hi,

    Are you sure? It seems to work for me.
    Have you copied and pasted the code I gave or typed it manually. If so check the '&' and quotes around ":G" and the closing brackets.

    Rgds

  10. #10
    Registered User
    Join Date
    11-23-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: full range variable....

    To, Richard Buttrey,
    your code works. i had made a small typing mistake. it works like a charm !! thanks a lot.

    to, ywgrietveld,
    sorry that i shifted to another code immediately. it assumed it would be difficult for me to understand the VlookUp function options so i shifted to an easier "MAX" function. neverthless thanks a lot for the code. it works.

    Thanks a lot.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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