+ Reply to Thread
Results 1 to 4 of 4

If next row of active cell has data then exit sub Worksheet change event

Hybrid View

  1. #1
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,095

    Post If next row of active cell has data then exit sub Worksheet change event

    hi,
    i am using below code to get last empty row of a range,

    If Not Intersect(Target, Range("I10:I1000")) Is Nothing Then
    Call LastRowSelect
    End If
    [CODE]Sub LastRowSelect()
    Dim lastrow As Long
    lastrow = Range("F" & Rows.Count).End(xlUp).Row + 1
    Range("F" & lastrow).Select
    End Sub[/CODE
    I need to change my code as
    if next row of active cell has some data then exit the sub

    for example
    i type some data in Range("I15") and range("I16") has already data then don't run the macro name called "LastRowSelect"

    thank you
    hope some one will help
    Use Code-Tags for showing your code :
    Please mark your question Solved if there has been offered a solution that works fine for you
    If You like solutions provided by anyone, feel free to add reputation using STAR *

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: If next row of active cell has data then exit sub Worksheet change event

    Maybe:

    If Not Intersect(Target, Range("I10:I1000")) Is Nothing Then
    If Target.Offset(1) = "" Then Call LastRowSelect
    End If

  3. #3
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,095

    Re: If next row of active cell has data then exit sub Worksheet change event

    Perfect
    thank you @JOHN H. DAVIS

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: If next row of active cell has data then exit sub Worksheet change event

    You're welcome. Glad to help out and thanks for the feedback and reps.

+ 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] How to check if a sheet is active before firing the worksheet change event
    By jrtraylor in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-17-2016, 03:28 PM
  2. Worksheet change event with multiple column cell value change
    By borgyang in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-29-2015, 11:53 AM
  3. Replies: 8
    Last Post: 08-06-2014, 04:41 AM
  4. [SOLVED] Worksheet change event code to display message box based on active cell offset content
    By Nitefox in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2014, 02:52 PM
  5. [SOLVED] worksheet change event only when certain cell changes
    By Thirsa in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-06-2013, 07:09 AM
  6. [SOLVED] Cell value change to trigger macro (worksheet change event?)
    By Neil Goldwasser in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-10-2006, 10:00 AM
  7. Replies: 5
    Last Post: 06-23-2005, 06:05 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