+ Reply to Thread
Results 1 to 2 of 2

default cell value

  1. #1
    Forum Contributor
    Join Date
    12-14-2012
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    143

    default cell value

    I am looking for code to change "If Intersect(Target, Range("G2")) Is Nothing Then Exit Sub
    " to if there is nothing, I want to have a default of Range("G2") = PL030. how can I change the code to default to this?
    I don't want to exit "Sub"

    Please Login or Register  to view this content.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,199

    Re: default cell value

    Hi, madhatter40,

    the line of code you mention is only checking for the cell which was changed in that sheet. If itīs not G2 then the macro will stop. I doubt you want the macro to start on any cell change in that sheet running your macro:
    Please Login or Register  to view this content.
    If you want to put in the value as a standard without triggering the macro, change the code after the Else to
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Last edited by HaHoBe; 02-03-2013 at 11:46 AM. Reason: Addition for changing value of Range("G2")
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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