+ Reply to Thread
Results 1 to 6 of 6

IF, THEN, ELSE statement to run macros

  1. #1
    Registered User
    Join Date
    11-13-2013
    Location
    United Kingdom
    MS-Off Ver
    Mac 2011
    Posts
    34

    IF, THEN, ELSE statement to run macros

    I want to build an if statment to run a choice of 3 macros.

    if the cell with a number in it is in column (F) run macro 'RUN_ALL_MACROS_F', if in column (H) 'RUN_ALL_MACROS_H', if in column (I) 'RUN_ALL_MACROS_I'

    Help will be much appreciated
    Last edited by will.girling; 11-19-2013 at 01:15 PM.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: IF, THEN, ELSE statement to run macros

    Please Login or Register  to view this content.
    based on it being in row 1 where the number is, I don't really understand exactly what you mean by "the cell with a number in it"

  3. #3
    Registered User
    Join Date
    11-13-2013
    Location
    United Kingdom
    MS-Off Ver
    Mac 2011
    Posts
    34

    Re: IF, THEN, ELSE statement to run macros

    i have rows 41-147 which each have one piece of data in either columns F, H or I.

    I want the macro to look in each row and choose the cell with data in, based on which row the data is in run the relating macro.

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: IF, THEN, ELSE statement to run macros

    Please Login or Register  to view this content.
    ?

  5. #5
    Registered User
    Join Date
    11-13-2013
    Location
    United Kingdom
    MS-Off Ver
    Mac 2011
    Posts
    34

    Re: IF, THEN, ELSE statement to run macros

    this doesnt seem to work. i think i need to define the range as F41:I147, and then make the macro work one row at a time to find the cell with data in, depending what column (F, H, or I) and run its macro. then drop to the next row check column, and run relative macro, all the way from row 41 to row 147.

    do you know how i would do this?
    Last edited by will.girling; 11-19-2013 at 11:40 AM.

  6. #6
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: IF, THEN, ELSE statement to run macros

    Well that is what it does, but there is nothing to say to your run_all_macros_f what row number you are working on - so I would assume that it would do the same thing regardless of what is in each row.

    Maybe if you could post an example spreadsheet with the run_all_macros codes and a brief description of what it does?

+ 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: 1
    Last Post: 10-02-2013, 09:05 PM
  2. Macros to input formaulas into a lot of cells. Formula has an IF statement
    By stylecrazy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2013, 04:22 PM
  3. Macros If Then Statement
    By bapella in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-30-2012, 09:37 AM
  4. Macros: Data cleaning macros not producing expected outputes.
    By bertlogdi1 in forum Excel Programming / VBA / Macros
    Replies: 31
    Last Post: 06-17-2011, 06:52 AM
  5. If then statement causing value issues in Macros
    By ssciarrino in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-29-2005, 02:10 PM

Tags for this Thread

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