Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    MsgBox Problem (Excel 2002/2003)

    HI

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    If E29 < 2000 Then
    MsgBox ("Please Use D Form")
    End If
    End Sub

    I am trying to use this formula on a worksheet named Input, where the value in E29 is generated by the formula =IF(NetSales=0,"No Data",NetSales), currently if E29 contains more than 2000 the message box still appears.

    Any ideas please.

    Braddy
    If you are a fool at forty, you will always be a fool

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MsgBox Problem (Excel 2002/2003)

    You should use Range("E29") instead of E29.

    Are you sure that you want the code to fire whenever the user moves to another cell (*any* cell)?

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: MsgBox Problem (Excel 2002/2003)

    Hi Hans

    Thank you for you prompt reply, I only want it to show when you actually open the sheet really, It's a warning to either add more value or use another workbook,

    Regards
    Braddy
    If you are a fool at forty, you will always be a fool

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MsgBox Problem (Excel 2002/2003)

    In that case, you shouldn't use the Worksheet_SelectionChange event, but the Worksheet_Activate event. Or perhaps even the Workbook_Open event in the ThisWorkbook module.

  5. #5
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: MsgBox Problem (Excel 2002/2003)

    Hi Hans

    Thanks for expert guidance on this, I will do as you suggest.

    Regards

    Braddy
    If you are a fool at forty, you will always be a fool

Posting Permissions

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