+ Reply to Thread
Results 1 to 8 of 8

Find Last Cell In range, and changing another Cell based on offset text

  1. #1
    Registered User
    Join Date
    03-16-2009
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    97

    Find Last Cell In range, and changing another Cell based on offset text

    If i have a range say E12:O12 and want to find the last cell before blank, lets say it finds m12 as the cell with the value before blank. then with m12 it needs to determine weather row 11 in the same column has Text either "S" or "F" if "S" then m12 = t if "F" then m12 offset(1,-1) = t. And just to make things more difficult i need the range E12:O12 to step 2 as well until it gets to E208:O208 .Noting that row 11 never changes and will always have either an "S" Or an "F"


    and also t = time()
    Last edited by radar_jynx; 05-05-2009 at 04:52 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Find Last Cell In range, and changing another Cell based on offset text

    Sounds like a PERFECT chance to upload a "before" and "after" workbook, easiest to see, right? Don't make the sample data TOO short, make sure it shows all the hurdles to overcome.

    Click on GO ADVANCED and use the paperclip icon to attach a file.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    03-16-2009
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Find Last Cell In range, and changing another Cell based on offset text

    test document.xlsx

    Here is an example file containing a long length of data however i cannot really provide a before and after, have a look and see what i mean.

    Thanks Heaps

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Find Last Cell In range, and changing another Cell based on offset text

    No? On Row 14, what is supposed to happen? P14 is the last value and P13 = "F", so...

    Is the letter "t" supposed to go on P14? Q14? P15?

    Then what about K24 with an "S" in K12?

  5. #5
    Registered User
    Join Date
    03-16-2009
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Find Last Cell In range, and changing another Cell based on offset text

    yes P14 is the last value and P13 = "F" so O15 becomes t
    N16 is another last value and N13 also = "F" so M17 becomes t


    so with the ones that row 13 = "S" not F
    then eg.
    K24 has K13 as "S" then K24 becomes t
    I32 has I13 as "S" then I32 becomes t

    and so on.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Find Last Cell In range, and changing another Cell based on offset text

    Try this macro:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-16-2009
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Find Last Cell In range, and changing another Cell based on offset text

    Thanks heaps that works exactly how i want it to, but can is there any way of making it so it doesn't automatically count the amount of rows eg. make it so it only goes from 14 to 208 not row.count

    Thanks

  8. #8
    Registered User
    Join Date
    03-16-2009
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Find Last Cell In range, and changing another Cell based on offset text

    thanks heaps i figured it out

    Cheers

+ 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