+ Reply to Thread
Results 1 to 7 of 7

Sequential "If" Statements

  1. #1
    Registered User
    Join Date
    05-24-2014
    Posts
    5

    Sequential "If" Statements

    I'm a bit stuck on some VBA code.

    Sheet "Key" lists the elements that must be copied from "City1" into "Sheet1"

    So far I have a macro that searches "City1" sheet for the first element in "Key" and returns that row into Sheet1.

    I need the macro to repeat this process for the remaining elements in "Key" (there are 15 total)...any help would be much appreciated!

    Here is the code I am using:

    Please Login or Register  to view this content.
    Last edited by alansidman; 05-24-2014 at 07:43 PM. Reason: code tags

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,945

    Re: Sequential "If" Statements

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between
    Please Login or Register  to view this content.
    tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    05-24-2014
    Posts
    5

    Re: Sequential "If" Statements

    Sincerest apologies, I will be sure to adhere to the rules in the future!

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Sequential "If" Statements

    I think this is what you are wanting to do. It is a little hard to tell without an example workbook:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-24-2014
    Posts
    5

    Re: Sequential "If" Statements

    Hi, thank you! I have attached a copy of the worksheet, let me know if it is helpful.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Sequential "If" Statements

    Stnkynts' code works too. I will leave for Stnkynts to adjust his/her own code.
    Attached Files Attached Files
    Last edited by AB33; 05-25-2014 at 09:08 AM.

  7. #7
    Registered User
    Join Date
    05-24-2014
    Posts
    5

    Re: Sequential "If" Statements

    Thank you all both for the help - this is exactly what I was looking for!

+ 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: 01-15-2014, 08:53 AM
  2. 7 nested IF statements with a SEARCH added IF(ISNUMBER(SEARCH({"INSUR","AP REFUND"}
    By michaelproctor001 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 12-10-2013, 02:13 PM
  3. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  4. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  5. [SOLVED] Using "IF" and "AND" statements with current time
    By Bill in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-18-2005, 04:06 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