+ Reply to Thread
Results 1 to 6 of 6

Code to stop vba from overwriting content of Offset cell

  1. #1
    Registered User
    Join Date
    04-09-2014
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    6

    Code to stop vba from overwriting content of Offset cell

    I have an event macro that puts data into columns AB&C if criteria in N matches requirement. I need to prevent that code from running if the cell in column b already contains data

    Please Login or Register  to view this content.
    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Code to stop vba from overwriting content of Offset cell

    if Target.Offset(0, -13).valiue <>"" then exit sub
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Code to stop vba from overwriting content of Offset cell

    @nathansav

    may be -12 and use code tags for code posting?

  4. #4
    Forum Contributor
    Join Date
    06-24-2005
    Location
    excelliot.com
    MS-Off Ver
    2007
    Posts
    325

    Re: Code to stop vba from overwriting content of Offset cell

    Try this

    Please Login or Register  to view this content.
    Cheers!!
    Last edited by excelliot; 06-16-2014 at 04:35 AM.

  5. #5
    Registered User
    Join Date
    04-09-2014
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Code to stop vba from overwriting content of Offset cell

    Thanks Excelliot, quick and so simple a solution, if you know how
    Thanks

  6. #6
    Forum Contributor
    Join Date
    06-24-2005
    Location
    excelliot.com
    MS-Off Ver
    2007
    Posts
    325

    Re: Code to stop vba from overwriting content of Offset cell

    Cheers!!

+ 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. Offset Cell content VBA
    By DaveMurray23 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 06-09-2014, 10:31 AM
  2. [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
  3. how to stop overwriting data with vba
    By ConfusedaboutVBA in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-27-2012, 08:56 PM
  4. Stop users overwriting cells
    By Sharp in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-13-2012, 08:10 AM
  5. stop user from overwriting a workbook
    By carsto in forum Excel General
    Replies: 7
    Last Post: 06-17-2010, 09:51 AM

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