+ Reply to Thread
Results 1 to 7 of 7

Sheets.ActiveCell.Offset

  1. #1
    Registered User
    Join Date
    09-20-2011
    Location
    Prague, Czech Republic
    MS-Off Ver
    Excel 2003
    Posts
    19

    Sheets.ActiveCell.Offset

    I had in code...

    Please Login or Register  to view this content.

    ...but it didn't work, so I declared the value of the cell in sheet "opravy" as a variable. But is there some better statement to solve this link to another sheet ?
    Last edited by Forty; 09-29-2011 at 03:42 AM. Reason: solved

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Sheets.ActiveCell.Offset

    What are you trying to achieve?

  3. #3
    Registered User
    Join Date
    09-20-2011
    Location
    Prague, Czech Republic
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Sheets.ActiveCell.Offset

    find a value from another sheet (sheet "opravy" and there offset cell) in this activated sheet

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Sheets.ActiveCell.Offset

    It's worth noting that the Find method in VBA isn't the same as the Find worksheet function.

    Generally in VBA if you want to find one string within another then Instr is what you want.

    Also, the sheets object doesn't contain an ActiveCell object, so if you want to find the ActiveCell on another sheet you'll have to activate it. If you want to deal with the cell on another sheet which matches the position of the Active cell on the active sheet you'll need something along the lines of:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-20-2011
    Location
    Prague, Czech Republic
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Sheets.ActiveCell.Offset

    okey, now better:

    I want to find value from sheet(2) in range from A3 to about A7000 in sheet(1), which has range from A3 to about A13000, so one value from 7000 of sheet(2) could be found in 13000 cells in sheet(1). If there is a match, excel have to prove next accordance, which is in column B on both sheets, so therefore the statement, which I wrote above with "Offsets"...

    P.S. Ignore the "Left" function, cause there is a "Mid" function too and the code is more complicated.

  6. #6
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Sheets.ActiveCell.Offset

    I'm still not sure quite what you're after, but how about this?

    Please Login or Register  to view this content.

    Does that point you in the right direction?

  7. #7
    Registered User
    Join Date
    09-20-2011
    Location
    Prague, Czech Republic
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Sheets.ActiveCell.Offset

    yep, I have ca. the same code. It's more complicated, cause there are blank cells too and the find procedure can't stop on this cell and must continue with finding on next row, but this I have already solved.

    My point in this thread was only to solve, how to get value from offset cell on another sheet and as you said, it could work when using "rngCurrentCell As Range". So thank you very much and we can mark this thread as solved.
    Last edited by Forty; 09-29-2011 at 03:44 AM. Reason: orthography

+ 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