+ Reply to Thread
Results 1 to 3 of 3

Create OR statement in macro code

  1. #1
    Forum Contributor
    Join Date
    05-04-2015
    Location
    Atlanta GA
    MS-Off Ver
    2010
    Posts
    108

    Create OR statement in macro code

    Please Login or Register  to view this content.
    columns 47 and 48 hold two different team names

    I keep getting a TYPE MISMATCH error.

    cells(36, 37) holds the team name

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

    Re: Create OR statement in macro code

    Each condition in an OR operation has to stand on its own as a logical expression. You are assuming that VBA will know to compare team to either cell, but it doesn't.

    Do this instead. Also you don't the need the Else because there is no code after it. Also indent your code.
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,279

    Re: Create OR statement in macro code

    ?
    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. Code/Macro return the value from a statement to a table cell?
    By Ms2BSwagg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-15-2018, 01:06 PM
  2. Create vba macro to extract balances from statement
    By vkyjoshi in forum Hello..Introduce yourself
    Replies: 3
    Last Post: 09-18-2016, 06:35 AM
  3. [SOLVED] Code to create Macro Button and Assigning Macro code
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-10-2014, 11:30 AM
  4. Macro to create statement of sales Ledger
    By Benjamin2008 in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 08-15-2011, 06:15 AM
  5. create a macro if else statement
    By aysrun in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 05-28-2009, 06:05 AM
  6. Insert macro name in code on call statement.
    By MarvInBoise in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-07-2006, 01:10 PM
  7. [SOLVED] how to create automatic macro with if statement or similar
    By betatryck_se in forum Excel General
    Replies: 2
    Last Post: 12-14-2005, 07:35 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