+ Reply to Thread
Results 1 to 3 of 3

Thread: VBA command for the message box with the values of cell

  1. #1
    Registered User
    Join Date
    09-23-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    56

    VBA command for the message box with the values of cell

    Hello,

    I need a VBA command with the message box containing the values at the end of the column in H & I.

    I have attached an excel sheet with the Input.

    I need an VBA command with the message box as " Balance of Dr = 4450.44 & Cr= 8584.73"
    Attached Files Attached Files
    Last edited by mohan_rajun; 10-25-2010 at 08:06 AM.

  2. #2
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: VBA command for the message box with the values of cell

    One possibility

        Dim dblDr As Double, dblCr As Double
        dblDr = Application.Lookup(9.99E+307, Sheets("Sheet1").Columns("H"))
        dblCr = Application.Lookup(9.99E+307, Sheets("Sheet1").Columns("I"))
        MsgBox "Balance of Dr = " & Format(dblDr, "0.00") & " & Cr= " & Format(dblCr, "0.00")
    if you know the values are always the last cells in the column then you could just use an End(xlUp) based approach if preferred.

  3. #3
    Registered User
    Join Date
    09-23-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: VBA command for the message box with the values of cell

    Hi,

    It helped me... Thanks a lot !!

+ 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.2.0