+ Reply to Thread
Results 1 to 5 of 5

ex. If statements for fields

  1. #1
    Registered User
    Join Date
    10-11-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2002
    Posts
    71

    ex. If statements for fields

    Hi there fellow VBA programmers!
    I am quite new at this kind of syntax, therefore I came to look for your great knowledge
    Currently I am working in finance, usually it doesnt require VBA except for this time.

    I have several sheets containing the frequency of the ansers, (0-5, and X for don't know.) I'll attach an image of one sheet.

    http://imgur.com/yqbZzF8

    There are several sheets, but they all look the same.

    First of all, I am not asking for the entire syntax, I understand that might be hazard But ofc that would be great if you did, if not some pointers or maybe some leads on how to solve it!

    What I want to do, is with a macro or more macros check the following for EACH sheet :D

    If a score is above a certain value (ex if someone voted over 3, 'if frequency for 3 > 0')
    For each question take Max Score - Min Score (ex, if highest score was 4 and lowest 1, 4-1 = 3)
    there is a field called average, i want to check if this value is higher then value (ex, if average > 3 then notify)
    same for the Standard deviation ( if standard deviation > 0.3 then notify)

    Thanks for helping and taking your time to this, I am rookie but trying to learn
    I am good with MySQL/Python if you might need some help with that in return!

    Regards
    C :D

  2. #2
    Forum Contributor
    Join Date
    04-24-2007
    Location
    NYC
    MS-Off Ver
    2k3/2k7/2010
    Posts
    270

    Re: ex. If statements for fields

    macros are like stored procedures. You can use variables/loops/if statements to insert/update/delete cells.

    Treat worksheets like tables and workbooks like databases.

    There are no joins, so you will have to do comparison in loops and its 1 to 1 comparisons, hope you like cursors.

    To start you off, you want to do a for statement for all worksheets in a workbook.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-11-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2002
    Posts
    71

    Re: ex. If statements for fields

    Quote Originally Posted by slx View Post
    macros are like stored procedures. You can use variables/loops/if statements to insert/update/delete cells.

    Treat worksheets like tables and workbooks like databases.

    There are no joins, so you will have to do comparison in loops and its 1 to 1 comparisons, hope you like cursors.

    To start you off, you want to do a for statement for all worksheets in a workbook.

    Please Login or Register  to view this content.


    Wohow, now I've got something to play with
    Thank you so much!
    Kind regards, have nice weekend 2!

    / C

  4. #4
    Registered User
    Join Date
    10-11-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2002
    Posts
    71

    Re: ex. If statements for fields

    Quote Originally Posted by slx View Post
    macros are like stored procedures. You can use variables/loops/if statements to insert/update/delete cells.

    Treat worksheets like tables and workbooks like databases.

    There are no joins, so you will have to do comparison in loops and its 1 to 1 comparisons, hope you like cursors.

    To start you off, you want to do a for statement for all worksheets in a workbook.

    Please Login or Register  to view this content.

    Quote Originally Posted by slx View Post
    macros are like stored procedures. You can use variables/loops/if statements to insert/update/delete cells.

    Treat worksheets like tables and workbooks like databases.

    There are no joins, so you will have to do comparison in loops and its 1 to 1 comparisons, hope you like cursors.

    To start you off, you want to do a for statement for all worksheets in a workbook.

    Please Login or Register  to view this content.
    Oki I've come up with this..
    But how do I get it to search through multiply cells? Like Selecting B6:B9?
    It works if I only select one cell, but what if I want to select a range such as B6:B9 and check if one of those cells are over 1?

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    04-24-2007
    Location
    NYC
    MS-Off Ver
    2k3/2k7/2010
    Posts
    270

    Re: ex. If statements for fields

    Are you trying to actively select the range with the mouse?

    Othweise you could another for loop,
    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)

Similar Threads

  1. Copy Excel data to Word fields and retain fields
    By GCW esq in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-06-2012, 10:31 AM
  2. How to Disable automatic fields in pivot table like total and count on fields
    By anushka in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-24-2009, 07:53 AM
  3. Differentiate between column fields and data fields in a pivot table
    By whiteheadw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-12-2009, 01:59 PM
  4. [SOLVED] Excel SHOULD NOT AUTO-CHANGE formated text fields to DATE FIELDS!
    By PSSSD in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-08-2006, 04:35 PM
  5. [SOLVED] If statements in Pivot Table Calculated Fields
    By Carmen in forum Excel General
    Replies: 1
    Last Post: 09-24-2005, 04: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