-
Nov 24th, 2012, 03:52 PM
#1
Thread Starter
PowerPoster
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
-
Nov 24th, 2012, 08:24 PM
#2
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
-
Nov 25th, 2012, 02:55 PM
#3
Thread Starter
PowerPoster
Re: versioning vba for excel
Originally Posted by westconn1
there has been a thread on this recently, do a search
sorry but search and re-search but not found
-
Nov 25th, 2012, 03:28 PM
#4
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
-
Nov 26th, 2012, 02:25 PM
#5
Thread Starter
PowerPoster
Re: versioning vba for excel
Originally Posted by westconn1
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
-
Nov 26th, 2012, 03:17 PM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|