Consulting

Results 1 to 4 of 4

Thread: Help with required entry before copy macro works

  1. #1
    VBAX Regular Erays's Avatar
    Joined
    Mar 2005
    Posts
    73
    Location

    Help with required entry before copy macro works

    If specific cells do not contain data I dont want the user to be able to use the copy macro.

  2. #2
    VBAX Expert
    Joined
    Feb 2005
    Posts
    929
    Location
    Quote Originally Posted by Erays
    If specific cells do not contain data I dont want the user to be able to use the copy macro.
    the approach here will depend on how many "specific cells" are involved and by "copy macro" you mean something you wrote or a system macro.

    If just a few cells and you wrote the copy macro then you might use something like this:

    Sub CopyMacro
    if Cells(1,4)="" or cells(3.5)="" or cells(8,1)="" then 
    msgbox "sorry, key cells are still empty; you can not copy",vbcritical + vbokonly
    exit sub
    end if
    end sub

    If the target cells nicely group into a range, you could test for empty cells in that range, etc. One method to test is demonstrated in this KB
    "It's not just the due date that's important, it's also the do date" [MWE]

    When your problem has been resolved, mark the thread SOLVED by clicking on the Thread Tools dropdown menu at the top of the thread.

  3. #3
    VBAX Regular Erays's Avatar
    Joined
    Mar 2005
    Posts
    73
    Location
    Thanks works great!!!

  4. #4
    VBAX Expert
    Joined
    Feb 2005
    Posts
    929
    Location
    glad to help. Please set thread to solved.
    "It's not just the due date that's important, it's also the do date" [MWE]

    When your problem has been resolved, mark the thread SOLVED by clicking on the Thread Tools dropdown menu at the top of the thread.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •