+ Reply to Thread
Results 1 to 25 of 25

Else Function

  1. #1
    Registered User
    Join Date
    10-08-2018
    Location
    Denmark
    MS-Off Ver
    2016
    Posts
    68

    Else Function

    I need som Help with this statement....

    If cell ("C4:c11") is <50 then Msgbox "you Got" C4 " Left " & " You may Now Close Game By 2 or 3 Dart's to close game"

    Ive try this Code

    Please Login or Register  to view this content.
    Last edited by jeffreybrown; 12-09-2018 at 09:38 AM. Reason: Fixed code tags!

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,790

    Re: Else Function

    Maybe
    Please Login or Register  to view this content.

  3. #3
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,052

    Re: Else Function

    Too late!!!
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  4. #4
    Registered User
    Join Date
    10-08-2018
    Location
    Denmark
    MS-Off Ver
    2016
    Posts
    68

    Re: Else Function

    it aint work
    Last edited by Henrik-Chr; 12-09-2018 at 09:57 AM.

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,790

    Re: Else Function

    Care to supply some more information?
    "it aint work" doesn't exactly give me much to go on

  6. #6
    Registered User
    Join Date
    10-08-2018
    Location
    Denmark
    MS-Off Ver
    2016
    Posts
    68

    Re: Else Function

    LOl Right ….

    I have put that code in from you and enter score in my cell When i Came to cell "C5" and have score left lower than 50 then it aint show Msgbox

    send you a link to my file on PM

  7. #7
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,052

    Re: Else Function

    Are you entering the value in C5 manually or is the value a result of a formula?

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,790

    Re: Else Function

    Please upload the file to the thread.
    to do that Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  9. #9
    Registered User
    Join Date
    10-08-2018
    Location
    Denmark
    MS-Off Ver
    2016
    Posts
    68

    Re: Else Function

    value from e Formula

    C5 = C6-B5

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,790

    Re: Else Function

    In that case try
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    10-08-2018
    Location
    Denmark
    MS-Off Ver
    2016
    Posts
    68

    Re: Else Function


  12. #12
    Registered User
    Join Date
    10-08-2018
    Location
    Denmark
    MS-Off Ver
    2016
    Posts
    68

    Re: Else Function

    as i can see it get Target value and that aint Right it is Left score there should be Showing in Msgbox

  13. #13
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,790

    Re: Else Function

    In that case simply remove the offset from target in the msgbox

  14. #14
    Registered User
    Join Date
    10-08-2018
    Location
    Denmark
    MS-Off Ver
    2016
    Posts
    68

    Re: Else Function

    I not sure What you Mean By That

    By The way I am No Expert i Google and find and try som VBA Codes and get them to Work

  15. #15
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,790

    Re: Else Function

    Just remove the part in red
    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    10-08-2018
    Location
    Denmark
    MS-Off Ver
    2016
    Posts
    68

    Re: Else Function

    Thanks I just Copy and Past That Code you just Put up here and Now it work by Changing ("B5:B11") to ("C5:C11")

    Thanks for Your Time to Help Mee

  17. #17
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,790

    Re: Else Function

    Glad to help & thanks for the feedback

  18. #18
    Registered User
    Join Date
    10-08-2018
    Location
    Denmark
    MS-Off Ver
    2016
    Posts
    68

    Re: Else Function

    Hm a litle question more if i may

    when i Get it on ("C5:C11") but also want it to work on ("E4:E9") how do i put that in the code

  19. #19
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,790

    Re: Else Function

    Based on your file try
    Please Login or Register  to view this content.

  20. #20
    Registered User
    Join Date
    10-08-2018
    Location
    Denmark
    MS-Off Ver
    2016
    Posts
    68

    Re: Else Function

    Hey Fluff13 i have now try the code and it works Ok
    until i use my Clean cell Macro
    then this error came up
    Private Sub Worksheet_Change(ByVal Target As Range)

    If Intersect(Target, Range("C4:C11,E4:E9,G4:G7,I3:I5,K3")) Is Nothing Then
    If Target.Offset(, 1).Value < 50 Then MsgBox "You Got " & Target.Offset(, 1).Value & " You may Now Close Game By 2 or 3 Dart's to close game"
    End If
    End Sub
    Runtime error 13 Type Mismatch and this line is Highlited in yellow
    If Target.Offset(, 1).Value < 50 Then
    Hope that was enough Info

    my code for Clean cell is
    Sub Nulstil50()
    '
    ' Nulstil50 Makro
    '

    '
    Range("J2:J3,H2:H5,F2:F7,D2:D9,B2:B11").Select
    Range("B2").Activate
    Selection.ClearContents
    End Sub

  21. #21
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,790

    Re: Else Function

    Did you try the code I supplied in post#19, rather than your own version?

  22. #22
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,790

    Re: Else Function

    Also the code you have supplied in post#20 is probably not doing what you think it's doing.
    Your code will trigger if ANY cell OTHER than the ones listed are changed.
    This is because the code I supplied earlier had a typo

  23. #23
    Registered User
    Join Date
    10-08-2018
    Location
    Denmark
    MS-Off Ver
    2016
    Posts
    68

    Re: Else Function

    see that's the mystic part of it

    the code WORKs on every Colom it first when i want to Clean cell it get wrong

  24. #24
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,790

    Re: Else Function

    What happens if you key a value in A1?

  25. #25
    Registered User
    Join Date
    10-08-2018
    Location
    Denmark
    MS-Off Ver
    2016
    Posts
    68

    Re: Else Function

    That was the Solution, Clear cell's and enter "0" to the cell and it works

    Thanks

+ 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. COUNTUNIQUE Function in Google Sheets; Excel lacks a direct counterpart to this function?
    By PivotTablePSHomage in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-18-2018, 05:27 AM
  2. Replies: 3
    Last Post: 08-14-2017, 06:26 AM
  3. Calling function inside function. (aka nested function)
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-02-2015, 05:58 AM
  4. VBA code for custom function that returns detail results of array function
    By onechipshot in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-10-2015, 06:30 PM
  5. Replies: 1
    Last Post: 06-10-2015, 12:56 PM
  6. Replies: 13
    Last Post: 04-08-2014, 05:46 AM
  7. Replies: 1
    Last Post: 03-21-2012, 11:22 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