+ Reply to Thread
Results 1 to 4 of 4

Just a little bit of function help

  1. #1
    Forum Contributor Stuie's Avatar
    Join Date
    09-17-2006
    Location
    Suffolk, UK
    MS-Off Ver
    Excel 2003/2007
    Posts
    432

    Just a little bit of function help

    basically what im tryin to do is with two label captions is to add them together and display the answer in one of the labels...

    i have managed to do this subtracting the two captions but not adding them example...

    to subtract them i did this:

    label1 caption is 30
    label2 caption is 10

    (Dont think i had to put .caption on the sum part)
    label1.caption = label1.caption - label2.caption

    and from that i get 20 as the caption

    now if i do the same sum but with + instead of - i get the answer 3010
    how do ya get round that...

    oh and how do u format a label caption to currancy so it always shows a (£)sign that wud be really helpful to know

    any help wud be very welcome

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    Try so:
    val(label1.caption) + val(label2.caption)

    The val function convert from string to value

  3. #3
    Forum Contributor
    Join Date
    11-11-2005
    Posts
    267
    Please Login or Register  to view this content.
    x = Application.Sum(Label1.Caption, Label2.Caption)
    MsgBox x
    HTH
    Myles

    ...constantly looking for the smoother pebble while the whole ocean of truth lies before me.

  4. #4
    Forum Contributor Stuie's Avatar
    Join Date
    09-17-2006
    Location
    Suffolk, UK
    MS-Off Ver
    Excel 2003/2007
    Posts
    432
    cool that brilliant thanx chaps

+ 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