+ Reply to Thread
Results 1 to 8 of 8

offset for row not working

  1. #1
    Registered User
    Join Date
    11-29-2020
    Location
    india
    MS-Off Ver
    2021
    Posts
    92

    offset for row not working

    i have a worksheet called mulogs

    first column A has dates and remaining have prices ... based on price entered i want it to check when the next date for close price is for the item. but it keeps giving #value when i use offset(1,0) for the upperval...but code works fine if i remove that and use simple c.value for the upperval just cant figure out y it doesnt work when i put in the offset code for upperval

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: offset for row not working


    As Offset(1, 0) is for the cell under like you can check just reading VBA help …

  3. #3
    Registered User
    Join Date
    11-29-2020
    Location
    india
    MS-Off Ver
    2021
    Posts
    92

    Re: offset for row not working

    yes the cell in next row under the current cell...thats wat i want to read. it its not working

  4. #4
    Registered User
    Join Date
    11-29-2020
    Location
    india
    MS-Off Ver
    2021
    Posts
    92

    Re: offset for row not working

    i tried another way to maybe check ith row below but now it returns blank value below is code for it

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by littleangel; 05-22-2022 at 09:08 AM.

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: offset for row not working


    Explain now your logic according to your attachment, what the code must achieve with details, samples …

  6. #6
    Registered User
    Join Date
    11-29-2020
    Location
    india
    MS-Off Ver
    2021
    Posts
    92

    Re: offset for row not working

    ok so when data is passed as findnextdt(BOOKS,21.6.4,03-01-2020) it first dynamically finds which colprefix i.e column ,colstart i.e start row and col i.e the number of offset from column
    to reach the date column to pick, using select case .Thhen it goes to the sheet mulogs and checks the concerned column i. this case for book its column B and cell value i.e c.value being b2's value and replaces therx in it and assignes it to upperval,
    then it goes it sassigns the value in a row above it to lowerval i.e of call B1. i need to find the first valid occurrence hence found =0 is only when its executed. it checks if chkprice is lesser than upperval & greater than lowerval, if yes
    then gets the newdt and if the date is greater than 03-01-2020 then its assigned to result and found is set to 1 and result is returned back....but it it returns only blank all the time.

  7. #7
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: offset for row not working


    As I'm a bit lost … Ok for date 03-01-2020 and BOOKS the value is cell mulogs!B3 aka 257.04277720 and not cell B2 or what I'm missing ?!

    And in your passed function what could mean 21.6.4 as a value ?
    No sense the reason why nothing can be found …

  8. #8
    Registered User
    Join Date
    11-29-2020
    Location
    india
    MS-Off Ver
    2021
    Posts
    92

    Re: offset for row not working

    ok let me try explaining it again...functions tries to check where 216 falls between 2 values in case of BOOKS its blank as condition doesnt satisfy but for PENS, value passed is 27, when it reaches cell C7 in loop,it should return the date 06-01-2020 as 27 is less that c7 value 33 and greater that c6 value of 21.

+ 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] Offset not working
    By wildecoyote1966 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-04-2022, 09:09 PM
  2. offset not working
    By Learning ExL in forum Excel - New Users/Basics
    Replies: 22
    Last Post: 04-19-2015, 05:54 PM
  3. [SOLVED] Can anyone tell me why this isn't working? .offset
    By Taemex in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-12-2014, 07:11 PM
  4. Offset not working
    By sput_sput in forum Excel General
    Replies: 12
    Last Post: 08-25-2010, 02:51 PM
  5. offset not working
    By BorisS in forum Excel General
    Replies: 2
    Last Post: 11-30-2005, 04:20 AM
  6. Offset now working?
    By sleah in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-08-2005, 01:57 AM
  7. Offset Not Working
    By sleah in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-07-2005, 05:56 PM

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