+ Reply to Thread
Results 1 to 4 of 4

Help with macro to give a message box

  1. #1
    Registered User
    Join Date
    05-17-2006
    Location
    Battle Creek, MI USA
    Posts
    11

    Unhappy Help with macro to give a message box

    Hello frineds,
    I was looking for a small macro that will give a error message if the value of cells in column M & J is same.
    Here is the main problem..
    This macro should get activated with a check box present in each row.

  2. #2
    Bob Phillips
    Guest

    Re: Help with macro to give a message box

    Add checkboxes from the forms toolbar, then assign each checkbox to this
    macro

    Sub CheckValues()
    Dim oCheckbox As CheckBox
    Dim iRow As Long
    With ActiveSheet
    Set oCheckbox = .CheckBoxes(Application.Caller)
    If oCheckbox.Value = xlOn Then
    iRow = oCheckbox.TopLeftCell.Row
    If .Cells(iRow, "J").Value = .Cells(iRow, "M").Value Then
    MsgBox "Same on row " & iRow
    End If
    End If
    End With
    End Sub



    --

    HTH

    Bob Phillips

    (remove nothere from the email address if mailing direct)

    "nik_gujarathi" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Hello frineds,
    > I was looking for a small macro that will give a error message if the
    > value of cells in column M & J is same.
    > Here is the main problem..
    > This macro should get activated with a check box present in each row.
    >
    >
    > --
    > nik_gujarathi
    > ------------------------------------------------------------------------
    > nik_gujarathi's Profile:

    http://www.excelforum.com/member.php...o&userid=34522
    > View this thread: http://www.excelforum.com/showthread...hreadid=543727
    >




  3. #3
    Tom Ogilvy
    Guest

    RE: Help with macro to give a message box

    You have a checkbox in each row and if it is checked or unchecked (or just
    checked?) you want it to fire a macro that puts up a msgbox if the value in
    columns M and J of that row have the same value. What kind of checkbox - is
    it from the control toolbox toolbar or the forms toolbar (the forms toolbar
    checkbox would be much more adaptable to this requirement)?

    --
    Regards,
    Tom Ogilvy


    "nik_gujarathi" wrote:

    >
    > Hello frineds,
    > I was looking for a small macro that will give a error message if the
    > value of cells in column M & J is same.
    > Here is the main problem..
    > This macro should get activated with a check box present in each row.
    >
    >
    > --
    > nik_gujarathi
    > ------------------------------------------------------------------------
    > nik_gujarathi's Profile: http://www.excelforum.com/member.php...o&userid=34522
    > View this thread: http://www.excelforum.com/showthread...hreadid=543727
    >
    >


  4. #4
    Registered User
    Join Date
    05-17-2006
    Location
    Battle Creek, MI USA
    Posts
    11

    Need Help on check box

    Tom,
    The value of cells in column M and J is linked to checkbox. When I chech the first box, the value of cell in column M becomes "TRUE", but when it is unchecked it is "False". Same is with the second checkbox. The second check box is linked with cells in column J. I want the user to check only one box in each row. I know I can do it by using the Option Button & group box, but there are some other macros which prohibits me using the group box. Hence I am using the check box option.
    I have used check box from the Form toolbar. Hence I was looking for a macro which will get fired with any of the check box & will give me an error message if the user checks both the boxes


    Quote Originally Posted by Tom Ogilvy
    You have a checkbox in each row and if it is checked or unchecked (or just
    checked?) you want it to fire a macro that puts up a msgbox if the value in
    columns M and J of that row have the same value. What kind of checkbox - is
    it from the control toolbox toolbar or the forms toolbar (the forms toolbar
    checkbox would be much more adaptable to this requirement)?

    --
    Regards,
    Tom Ogilvy


    "nik_gujarathi" wrote:

    >
    > Hello frineds,
    > I was looking for a small macro that will give a error message if the
    > value of cells in column M & J is same.
    > Here is the main problem..
    > This macro should get activated with a check box present in each row.
    >
    >
    > --
    > nik_gujarathi
    > ------------------------------------------------------------------------
    > nik_gujarathi's Profile: http://www.excelforum.com/member.php...o&userid=34522
    > View this thread: http://www.excelforum.com/showthread...hreadid=543727
    >
    >

+ 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