+ Reply to Thread
Results 1 to 4 of 4

setting variables for 2 cells on active selected row

  1. #1
    Registered User
    Join Date
    11-12-2007
    Posts
    38

    setting variables for 2 cells on active selected row

    Hi all, I have the following code for clearing all data on currently selected row but wish to incorporate 2 variables which
    are both time cells and have each referenced to a third cell ($Y$1) (THIRD VARIABLE) which is an absolute time reference cell in my code.

    I'd like my code to exit sub if either of my two variables is less than the current time.

    The two variables in question need to be drawn from columns (F) and (J) respectively and compared to cell ($Y$1)

    For example if row 35 is selected and I run my macro, if the value of $Y$1 is greater than "either" F35 or J35 than my code finishes and exits sub....
    If F35 AND J35 both are greater than $Y$1 than my code can run as per normal and the row contents are cleared...

    ANY HELP GREATLY APPRECIATED.


    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: setting variables for 2 cells on active selected row

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    11-12-2007
    Posts
    38

    Re: setting variables for 2 cells on active selected row

    Thanks TM, it worked a treat, you have yourself a ripper day

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: setting variables for 2 cells on active selected row

    You're welcome.


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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] Setting the range as only those cells selected/ highlighted
    By strud in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2013, 06:45 AM
  2. Setting variables
    By clueless2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-23-2013, 04:59 AM
  3. InputBox selects active cell, not selected cells?
    By kidmiuso in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-15-2010, 09:50 AM
  4. Check selected cells are right of active cell
    By papata123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-12-2007, 02:10 PM
  5. Setting TAB to navigate to selected Cells Only
    By Corey in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-29-2006, 05:00 AM

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