+ Reply to Thread
Results 1 to 4 of 4

VBA - Insert a IF function within an exiting coding.

  1. #1
    Registered User
    Join Date
    08-06-2014
    Location
    Sydney
    MS-Off Ver
    excel 2010
    Posts
    4

    VBA - Insert a IF function within an exiting coding.

    Hello All,
    I need to insert a piece of coding in an existing code and I am totally new to VBA. here is the original code :

    Please Login or Register  to view this content.
    What I want to do is to add a condition in the section : 'If weekend or weekday > 3pm.
    I have a new column (column O) with 4 types of values possible : FULL, RESTRICTED, DESKTOP and RURAL.
    what if want to do is : IF the value in Column O is FULL, RESTRICTED or RURAL then the part of the code :
    Please Login or Register  to view this content.
    Is to be applied. If the cell in column O is = DESKTOP, then this coding is not to be applied.

    I don't know if it makes sense to you or not. Please let me know if you you need more info.

    Thanks.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: VBA - Insert a IF function within an exiting coding.

    either add another if statement to check before the code

    or add the criteria to this one

    Please Login or Register  to view this content.

    I havent seen your file so have just added range("o1")
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Registered User
    Join Date
    08-06-2014
    Location
    Sydney
    MS-Off Ver
    excel 2010
    Posts
    4

    Re: VBA - Insert a IF function within an exiting coding.

    Thank you very much Nathansav! It worked my range is unknow (it can go anywhere between 150,000 rows 500,000 or more).
    So how would you enter that in the coding?

  4. #4
    Registered User
    Join Date
    08-06-2014
    Location
    Sydney
    MS-Off Ver
    excel 2010
    Posts
    4

    Re: VBA - Insert a IF function within an exiting coding.

    OR for a range o1:o300000. Any idea anyone?

+ 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. "if cell contains text Insert row below" coding works the opposite
    By momad in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-25-2012, 11:20 PM
  2. [SOLVED] Dynamic function - VBA coding
    By bfournier5 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-19-2012, 07:39 AM
  3. Help in VBA Coding (DO WHILE / LOOP UNTIL) FUNCTION
    By gvreddyhr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-29-2011, 03:05 AM
  4. Vba coding required for count and insert
    By meet2mayank in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2010, 06:30 AM
  5. Using the IF function for salary coding
    By henesy in forum Excel General
    Replies: 3
    Last Post: 08-09-2009, 04:42 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