+ Reply to Thread
Results 1 to 4 of 4

Checking Offset Assumptions

  1. #1
    Registered User
    Join Date
    09-05-2011
    Location
    St. John's, Canada
    MS-Off Ver
    Excel 2010
    Posts
    70

    Checking Offset Assumptions

    Hey Everyone,

    I'm trying to create a check in my Excel Macro to check if my assumptions are correct. For example in a given worksheet I want to find the row labeled "Mouse/Day". Once I've found this row I assume the column "Cat" is one column to the right. But what if it wasn't? what if the columns had been input in a wrong order. Instead of the cat column being at an offset of ( 0, 1) the dog column was there instead. Is there a creative way to check ?

    Thanks for your help everyone! You've all been great these past weeks.

    Please Login or Register  to view this content.
    Last edited by ashleys.nl; 09-14-2011 at 10:05 AM.

  2. #2
    Registered User
    Join Date
    11-17-2010
    Location
    MN, USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Checking Offset Assumptions

    Instead of using .offset with the Mouse/day column, why not just find the column number that "Cat" is in and use that directly? Assuming, of course, that you won't have problems with the word "cat" coming up multiple times in the spreadsheet, in which case you'll want to restrict the search range from .cells to something smaller.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-05-2011
    Location
    St. John's, Canada
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: Checking Offset Assumptions

    Ahhh okay, I can certainly use something like this... I didn't know the .Column and .Row funtions existed... I'll have a go at this code later today... but it looks great! Thanks for the help

  4. #4
    Registered User
    Join Date
    09-05-2011
    Location
    St. John's, Canada
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: Checking Offset Assumptions

    Thanks Chris!

    I've taken what you had suggested and added a way to indentify the row as well. but it works great! this is the final code I've created... in case anyone else comes accross this problem

    Thanks again Chris

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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