+ Reply to Thread
Results 1 to 5 of 5

Problem with my If...Then...Else statement???

  1. #1
    Registered User
    Join Date
    05-24-2023
    Location
    Budapest, Hungary
    MS-Off Ver
    365
    Posts
    6

    Problem with my If...Then...Else statement???

    Hi,
    I'm quite a beginner in macro generating and I have an issue, that I can't solve.. I have 3 separate Excel files (Table1...3). I have the macro in the 1st one.
    The task is the following:
    With the Do...Loop statement I want to go through on the 10 items in table1. Grabbing each item I want to find the same item in table2. If it can be found I want to copy and paste that and it's neighbour cells to table1, then I want to find the same item in table3 as well and copy from there a cell as well to table1. The problem occurs when the item can't be found in table2. That time I just want to move ahead to the next item to be searched, but the script always stops.
    Where did I make a mistake??
    table2.xlsxtable3.xlsxtable1.xlsm
    Last edited by nagy.den; 05-25-2023 at 01:03 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: Problem with my If...Then...Else statement???

    Welcome to the Forum nagy.den!

    There is no code in file table1.xlsm.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    05-24-2023
    Location
    Budapest, Hungary
    MS-Off Ver
    365
    Posts
    6

    Re: Problem with my If...Then...Else statement???

    Sorry, meanwhile I found out the bug Thanks anyway
    Last edited by nagy.den; 05-25-2023 at 01:20 AM.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,404

    Re: Problem with my If...Then...Else statement???

    Please share the solution.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    05-24-2023
    Location
    Budapest, Hungary
    MS-Off Ver
    365
    Posts
    6

    Re: Problem with my If...Then...Else statement???

    An other problem occured
    I improved the script a bit and I'm confused how can I refer to a cell with offset property, without making an active cell of it. I put "???" to thementioned line.
    If I find a correct cell in table2 I want to check if the cell from 3 cells right of the found cell is empty or not.
    table1_new.xlsmtable2_new.xlsxtable3_new.xlsx

+ 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. [SOLVED] IF statement problem
    By mysticloud in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-22-2019, 05:07 AM
  2. IF AND Statement Problem
    By seanturner9005 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-12-2013, 05:01 AM
  3. Now() statement within a IF(AND statement problem
    By Modify_inc in forum Excel General
    Replies: 3
    Last Post: 03-27-2011, 04:17 PM
  4. IF statement with OR problem
    By YBrazeau in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-08-2010, 02:57 PM
  5. Problem with IF statement within a COUNTIF statement
    By girlofscience in forum Excel General
    Replies: 5
    Last Post: 04-22-2009, 10:20 AM
  6. Problem with an IF Statement
    By The Salad in forum Excel General
    Replies: 13
    Last Post: 08-10-2007, 09:17 AM
  7. [SOLVED] IF Statement Problem
    By RagDyer in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-06-2005, 06:05 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