+ Reply to Thread
Results 1 to 4 of 4

If Cell1 <>0 then Cell 2 should = text or numbers, if Cell2 has data then continue macro,

  1. #1
    Registered User
    Join Date
    05-10-2014
    MS-Off Ver
    Excel 2003
    Posts
    22

    If Cell1 <>0 then Cell 2 should = text or numbers, if Cell2 has data then continue macro,

    All Cells are on Sheet1

    T14 is numeric 0.00

    T15 is general(can be text or numbers)


    So what i would like to happen is this.

    Part A.
    If T14 <> 0
    Then T15 has to contain either letters or numbers
    **Now the Macro can continue to the next step**
    If T15 does not contain either letters or numbers but T14 <> 0 then message box Critical "Please Enter Data Into T15"
    ***Stop the macro from continuing until data is entered into T15
    Part B.
    If T14 = 0.00
    Then T15 = nothing or " "

    Now here's the other trick. This same macro has another validation that i have already figured out. Do i need to combine the
    Code into one long if statement with the ending being to continue the macro?

    or can i have it set up with separate if statements?

    I know they will be both written inside of the macro's private sub or one large statement in the macros private sub. I just need to know which method to use once we get to that point.

  2. #2
    Forum Contributor
    Join Date
    03-12-2013
    Location
    Chicago, USA
    MS-Off Ver
    Excel 2007
    Posts
    230

    Re: If Cell1 <>0 then Cell 2 should = text or numbers, if Cell2 has data then continue mac

    The code for the first two parts is below. Regarding your final inquiry, I personally like to separate the validations into individual sections. This makes it easier for future troubleshooting, especially if somebody other than you has to look at the code later.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-10-2014
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: If Cell1 <>0 then Cell 2 should = text or numbers, if Cell2 has data then continue mac

    swoooo... it worked and it wasnt that difficult either. Thank you.
    i kept trying to use "AND" but it was not working for me. Why the use of "TRIM"?

  4. #4
    Forum Contributor
    Join Date
    03-12-2013
    Location
    Chicago, USA
    MS-Off Ver
    Excel 2007
    Posts
    230

    Re: If Cell1 <>0 then Cell 2 should = text or numbers, if Cell2 has data then continue mac

    Trim is probably not necessary. I have just grown accustomed to using it because of the data I deal with. For your purposes, you should be able to remove it with no issues.

+ 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. Replies: 2
    Last Post: 02-10-2013, 05:54 PM
  2. [SOLVED] Is there a function, if cell1=Text then cell2=#? Excel 03
    By in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 07:05 AM
  3. [SOLVED] Is there a function, if cell1=Text then cell2=#? Excel 03
    By A>Bøb±Ë¬²*'²hœ®‹(~×( in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  4. Is there a function, if cell1=Text then cell2=#? Excel 03
    By A>Bøb±Ë¬²*'²hœ®‹(~×( in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  5. Is there a function, if cell1=Text then cell2=#? Excel 03
    By A>Bøb±Ë¬²*'²hœ®‹(~×( in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-01-2005, 03:05 PM

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