Consulting

Page 2 of 2 FirstFirst 1 2
Results 21 to 33 of 33

Thread: Formula returning false when it shouldn't

  1. #21
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,711
    Location
    Quote Originally Posted by boccuz View Post
    wow.. Thanks. So I just copy the cell down to row 50?
    Should be all that's needed

    The important thing is Application.Caller witch is the cell that the formula is in

    Once we have that, we know the .Row and that allows us to go to the correct worksheet
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  2. #22
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,711
    Location
    If that works out, I noticed that it looks like you could have 100 buttons in A and B on "1", with the only difference being the virtually identical 1 of 100 macros

    Maybe using a worksheet event hander to process a double click in A4, B4, A5, B5, .... would be easier

    Option Explicit
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
        Dim r As Long, c As Long
        
        With Target.Cells(1, 1)
            r = .Row
            c = .Column
        End With
        
        If r < 4 Or r > 50 Then Exit Sub
        If Len(Me.Cells(r, 4).Value) = 0 Then Exit Sub
            
        If c = 1 Then
            Call Application.Goto(Worksheets(CStr(r)).Range("A49"), True)
        ElseIf c = 2 Then
            Call Application.Goto(Worksheets(CStr(r)).Range("A75"), True)
        End If
    End Sub
    I accidently deleted the "Home" button macro
    Attached Files Attached Files
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #23
    VBAX Regular
    Joined
    Jan 2018
    Posts
    35
    Location
    don't think I am copying the code correctly. I cannot get the formula to work in my working spreadsheet. I get ###### as a result.

    I am going to Developer > Visual Basic > Module1_UDF > View Code then copy the code inside the box. not sure about about "Option Explicit" I don't see that. what am I missing?

  4. #24
    VBAX Regular
    Joined
    Jan 2018
    Posts
    35
    Location
    actually, I am not seeing a Module1_UDF in my working spreadsheet. Only see it when your attachment is opened.

  5. #25
    VBAX Regular
    Joined
    Jan 2018
    Posts
    35
    Location
    a lot of those macros are broken. I tried deleting, but couldn't. the delete button was grayed out.

  6. #26
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,711
    Location
    Quote Originally Posted by boccuz View Post
    actually, I am not seeing a Module1_UDF in my working spreadsheet. Only see it when your attachment is opened.
    I inserted a new Standard Module, named it Module1_UDF, and wrote the macro on that

    Capture.JPG
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  7. #27
    VBAX Regular
    Joined
    Jan 2018
    Posts
    35
    Location
    Don't know what i am doing wrong. I copied in my working spreadsheet and am getting false regardless of argument. I did the same test in my sample spreadsheet and it worked. copied to both spreadsheet exactly the same

  8. #28
    VBAX Regular
    Joined
    Jan 2018
    Posts
    35
    Location
    would you be willing to meet with me over skype and I will share my screen to show you what i am seeing? The file size of the working spreadsheet is too large for me to attach.

  9. #29
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,711
    Location
    easier to just attach a workbook with "1", "4", and "5" again to the forum

    Include the version of the macro you're having issues with

    It works with ver 3 -- basically the same as ver 2 --

    Do you have calculation set to automatic?
    Attached Files Attached Files
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  10. #30
    VBAX Regular
    Joined
    Jan 2018
    Posts
    35
    Location
    Here is the sample spreadsheet.

    I copied to earnedmimimum code to module 1.





    Master_Service_Award 4.xlsm

  11. #31
    VBAX Regular
    Joined
    Jan 2018
    Posts
    35
    Location
    yes, calculations is set to auto.

  12. #32
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,711
    Location
    When you put the function in, you didn't remove the formula, so it was probably testing something like (formula) = (function) as a Boolean, and since they didn't match the answer was False

    Capture.JPG

    Try ver 5
    Attached Files Attached Files
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  13. #33
    VBAX Regular
    Joined
    Jan 2018
    Posts
    35
    Location
    jeez... thanks. working now. I truly appreciate your help on this. Thank you very much!

Posting Permissions

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