+ Reply to Thread
Results 1 to 5 of 5

Condition and function to write number value greater than a specific number

  1. #1
    Registered User
    Join Date
    11-06-2012
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2010
    Posts
    19

    Question Condition and function to write number value greater than a specific number

    Hi Friends,

    I am new to VBA and need help regarding one condition.
    How can I write to check if the value in a specific cell is more than 4000 or not and whether the value is a number or not.

    This is what I have written write now.

    #
    Please Login or Register  to view this content.
    I understand what I have written checks for # 4 and not for a number greater than 4000. Please advice.

    Thanks
    Jay
    Last edited by arlu1201; 11-12-2012 at 06:38 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Condition and function to write number value greater than a specific number

    I think you meant to put code tags on these, but you don't type "#", you use the "#" button above your text. See note farther below.

    Please Login or Register  to view this content.
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    11-06-2012
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Condition and function to write number value greater than a specific number

    Thanks a lot ! That worked well. I actually started using another statement and it worked for me because all the codes in that column begins with 4
    #
    If Worksheets("Albany_MA").Cells(i, col1).Value Like "4*" Then
    #

    There is one more issue that I am facing and it is causing a huge issue for my entire code. It would be great if you could advice me something regarding that as well.


    We need to count the # of M between O in first row and O in second row. If there are M after O in second row we need to count that as well.
    So lets say there is a column B and C
    ------------------------
    Col B Col C
    O ABC
    M
    M
    M

    O DEF
    M
    M
    ----------------------------
    The macro should first look for a keyword O in col B. If col B has O then it should copy ABC to the target file under col ORG. The # of times ABC should be copied depends on how many M are there under it. So if there are 3 M then it should be copied 3*7 i.e. = 21 times(occupying 2-22 rows under col ORG). Now it should look it there are any other O in col B or not. If there is another O then DEF should be copied in target file under col ORG. As there are 2 M so it should be copied 2*7 = 14 times occupying row 23-35.

    I was trying to do this through For loop but could not do so.

    Please help. Thanks
    Jay

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Condition and function to write number value greater than a specific number

    Please read the rule about code tags, and the instructions for how to use them.

    Your second question is a completely new question. You might get better responses by starting a new thread.

  5. #5
    Registered User
    Join Date
    11-06-2012
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Condition and function to write number value greater than a specific number

    Thanks ! I have already posted this but haven't got any replies. Will wait then.

    Thanks
    Jay

+ 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