+ Reply to Thread
Results 1 to 3 of 3

caption + 1

  1. #1
    Registered User
    Join Date
    10-31-2006
    Posts
    6

    caption + 1

    Hey dudes, trying to find out how I would add a number each time a browser loads in excel...

    If I've got a label with a caption (a number), I want to add 1 each time a browser loads... the label is label3.

    I tried:

    Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
    Label3.Caption +1
    End Sub
    but it always automatically corrects the +1 to 1.
    I can do -1, but this is not what I want!
    I've done this before, with something on the outside of the +1, I just can't remember it.

    Sorry for my english again!

    Pete

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481
    This code adds one to A1 each time the macro is run, I am going to try to get it to work for a label

    Please Login or Register  to view this content.

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481
    I am not going to spend to much time on this,
    this works, you may have to select a different rage in case A1 is already occupied

    this is assuming we are talking about a userform, so this code would go into the command button

    Private Sub CommandButton1_Click()

    MyCount = Range("a1") + 1
    Range("a1") = MyCount
    Label1.Caption = Range("A1")


    End Sub

+ 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