Results 1 to 6 of 6

Thread: versioning vba for excel

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,580

    versioning vba for excel

    Possible to store in a cell of sheet a increment of number to simulate major, minor, revision in vb6?
    All in the event Beforesave of workbook

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: versioning vba for excel

    there has been a thread on this recently, do a search
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,580

    Re: versioning vba for excel

    Quote Originally Posted by westconn1 View Post
    there has been a thread on this recently, do a search
    sorry but search and re-search but not found

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: versioning vba for excel

    haha, i found it easy, it was your previous thread on the same subject

    you would have to specify any update value, except the revision, no way to automatically tell if major or minor update, unless you code it in elswhere

    Code:
    mm = inputbox ("major /minor increase? Format ""01.01""" , left(range("x3"), 5))   ' where X3 is the cell containing current version
    if mm = mm & "." left(range("x3"), 5) then v = ".00" else v = right(range"x3"), 3) +.01
    range("x3").value = mm & v
    no tested at all, will give problem above version 99, version resets to 0 with major/minor change
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,580

    Re: versioning vba for excel

    Quote Originally Posted by westconn1 View Post
    haha, i found it easy, it was your previous thread on the same subject

    you would have to specify any update value, except the revision, no way to automatically tell if major or minor update, unless you code it in elswhere

    Code:
    mm = inputbox ("major /minor increase? Format ""01.01""" , left(range("x3"), 5))   ' where X3 is the cell containing current version
    if mm = mm & "." left(range("x3"), 5) then v = ".00" else v = right(range"x3"), 3) +.01
    range("x3").value = mm & v
    no tested at all, will give problem above version 99, version resets to 0 with major/minor change
    sorry but your code have many sintiax error

  6. #6
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: versioning vba for excel

    sorry but your code have many sintiax error
    that is what you get typing code into a webbrowser and not testing, try fixed and tested version
    Code:
    mm = InputBox("major /minor increase? Format ""01.01""", , Left(Range("b3"), 5))    ' where B3 is the cell containing current version
    If mm = Left(Range("b3"), 5) Then v = Right(Range("b3"), 3) + 0.01 Else v = ".00"
    Range("b3").Value = mm & v
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

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



Click Here to Expand Forum to Full Width