+ Reply to Thread
Results 1 to 4 of 4

If Statement to Check if a Particular Row is Selected

  1. #1
    Registered User
    Join Date
    07-14-2014
    Location
    Los Angles, United States
    MS-Off Ver
    2007
    Posts
    12

    If Statement to Check if a Particular Row is Selected

    I have a macro right now which makes a selection and then checks that selection to make sure it has less than 5,000 rows. If it has more, then a message box appears and we end the macro. However, in order for this macro to work properly for me, I need to change the if statement so that instead of checking for the amount of rows selected, I only need it to check if ROW 2 is selected. Is this possible? If not, can we have an IF statement to check the contents of ROW 2 (Row 2 is my header on the worksheet and will never change)? Here is the code I currently have:

    Please Login or Register  to view this content.
    Last edited by excel6000; 07-18-2014 at 12:58 PM.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: If Statement to Check if a Particular Row is Selected

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

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] 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 here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

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

    Re: If Statement to Check if a Particular Row is Selected

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    07-14-2014
    Location
    Los Angles, United States
    MS-Off Ver
    2007
    Posts
    12

    Re: If Statement to Check if a Particular Row is Selected

    Thank you for you help!!

+ 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. Check if SpecialCells are selected
    By bsamuels in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-03-2014, 05:32 PM
  2. How to check if selected cell is in row 10
    By Launchnet in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-14-2009, 12:41 AM
  3. Check selected cells for info
    By adam2308 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-08-2009, 07:09 AM
  4. VBA - Check if selected worksheets exist
    By Lucifix in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-06-2009, 05:04 AM
  5. How do I check the number of rows selected
    By dpatwary@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-08-2006, 08:30 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