+ Reply to Thread
Results 1 to 10 of 10

Loop and offset problem

  1. #1
    Registered User
    Join Date
    05-25-2019
    Location
    Denmark
    MS-Off Ver
    2019
    Posts
    13

    Loop and offset problem

    Hi all,

    it seems that im in trouble here, my
    Please Login or Register  to view this content.
    won't paste value even though .range("i48") and shares 2 is value.

    furthermore my whole offset function is bad. egenkapital.offset(0,1) doesn't work either. but the plan was that it would paste value and move on to the next column and stop when ""

    thanks


    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    7,572

    Re: Loop and offset problem

    What is BV?

    Have you set BV = worksheet("Sheet1") or something similar
    Please Avoid Joining My List Of Blocked Users by:

    Saying Please and Thank you.

    Making requests not demands.

    Checking back on your post. I will not edit any post after 4 days.

    Marking threads as closed once your issue is resolved. How? The tools at the top

    Any reputation (*) points appreciated. None of us gets paid here.

    If you found someone's input useful, please take a second to click the * at the bottom left to let them know

  3. #3
    Registered User
    Join Date
    05-25-2019
    Location
    Denmark
    MS-Off Ver
    2019
    Posts
    13

    Re: Loop and offset problem

    I have this one, do I need to write set in front of it?
    Please Login or Register  to view this content.
    thanks for looking into this :D

    best regards André

  4. #4
    Forum Guru
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    7,572

    Re: Loop and offset problem

    Yes. That is your issue.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-25-2019
    Location
    Denmark
    MS-Off Ver
    2019
    Posts
    13

    Re: Loop and offset problem

    I've tried that now, it still won't do it.
    basically I what it to know that
    Please Login or Register  to view this content.
    is the cell where it drops off the first calculated value.
    afterwords it offsets both the
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    and the other statements ( egenkapital, udstedetaktier and so on. but my lines
    Please Login or Register  to view this content.
    is a 438 error

    thanks again

  6. #6
    Registered User
    Join Date
    05-25-2019
    Location
    Denmark
    MS-Off Ver
    2019
    Posts
    13

    Re: Loop and offset problem

    My mistake I misspelled in the line, now its just the offset function that runs a 438 error :D

  7. #7
    Forum Guru
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    7,572

    Re: Loop and offset problem

    Ok Lets go back a bit.

    What Do you understand this statement to mean?

    A = .Offset(0, 1) I guess you think it means BV.offset(0,1) ................ Wrong.

    With your code it actual means: Sheets(Ticker).offset(0,1) which is impossible. You offset from a cell or a range not from a Sheet.

    You Said:
    Please Login or Register  to view this content.
    from that point onwards "." means "Sheets(Ticker)." so
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    05-25-2019
    Location
    Denmark
    MS-Off Ver
    2019
    Posts
    13

    Re: Loop and offset problem

    True, I didn't think it would offset the sheet.
    Im trying to offset egenkapital and udstedsaktier in one sheet and BV in another, horizontal and vertical respectively.
    so take the 2 values (egenkapital and udstedtaktier), calculate it, paste into another sheet, then offset egenkapital and udstedtaktier and the BV, so the next calculation can proceed in now BV=sheets("valuation").range("n9"), really hope it makes sense, and sorry for my lack of knowledge

    thanks for helping

  9. #9
    Forum Guru
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    7,572

    Re: Loop and offset problem

    Try This


    Please Login or Register  to view this content.
    Last edited by mehmetcik; 03-06-2020 at 12:48 PM.

  10. #10
    Registered User
    Join Date
    05-25-2019
    Location
    Denmark
    MS-Off Ver
    2019
    Posts
    13

    Re: Loop and offset problem

    Great, it works perfectly!!
    very grateful, thanks

+ 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] VBA Loop and offset
    By Spyderwoman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-02-2018, 12:51 AM
  2. Using Offset in a loop
    By anthony1312002 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-01-2017, 02:01 PM
  3. Using offset to loop?
    By MeggieDoodles in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-22-2015, 03:29 PM
  4. [SOLVED] For..Next, offset, nested loop
    By Gingin8639 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-05-2012, 10:23 AM
  5. VBA Loop & Offset Syntax
    By bgintheusa in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-23-2010, 09:06 PM
  6. Using offset with in a loop
    By hoffey in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-30-2009, 05:49 PM
  7. VBA help for DO LOOP and Offset
    By NKeller in forum Excel General
    Replies: 1
    Last Post: 07-04-2005, 08:05 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