When taking the difference between 2 times, how can I turn the value back into a time-formated string? for instance:
time1 = now
time2 = now
tdif = timevalue(time1) - timevalue(time2)
timevalue seems to use/return a double precision float. how do I convert the value of tdif to a time format...
Any suggestions on how to convert this to work off the system timer. I'd like to be able to incorporate a "pause" function for use on different systems so the length of the pause can be uniform between the systems. The only things I know about using the system timer are the TIMER function (as...
This is a workaround I came up with to help automate the process of running some ebay auctions. It requires babysitting and your code will need to be modified each time the web page is changed. It can be helpful though.
Of course you'll have to take my example and modify it to your...
I'm having a problem with getting , I believe, either the InStr or Mid$ functions to work the way I want them to. My intention is to get the US Naval Observator's Eastern Standard time directly from their web page you can use to check the time they are keeping.
I posted about this problem once...
I just figured out how to get the code to execute. Follow the url to Microsoft's explaination of where to put the code.
http://office.microsoft.com/en-us/assistance/HA010346281033.aspx
look under "Creating a VBA procedure for the Open event of workbook" on that page
Actually, you only need...
Whoops, I just realized I put the cart before the horse. The code above will give the result you are looking for only if it is executed each time the excell file is opened. I don't know where to put the code so that will happen.
Sub use_counter()
Dim sPath As String
Dim iFileNum As Integer
sPath = "C:\Documents and Settings\All Users\Desktop\filecounter.txt"
iFileNum = FreeFile
Open sPath For Append As iFileNum 'open or create the text file
Print #1, Now 'write current date and time to text file
Close #1 'close text...
Darn, I was hoping that wouldn't be the case as there are bound to be duplicate data stored in the list. Oh well, comparing properties can be worked with. Maybe I'll include an index property or some other unique identifier.
BTW, how do you post the code window in your message?
I'm thinking of using a linked list to store a list of records instead of using cells on a spreadsheet to store the individual data. This is in case I decide down the road to make an executable with VB instead of keeping the VBA version I'm writing now. I don't have VB compiler right now so...
Thats how I think of pointers also, I think. The pointer variable holds the address of the object, right? What I thought is that if two pointers point to the same object, they would both contain the same address and could be compared on that basis.
Here's an example of the code that is giving...
Anyone know how I can compare 2 pointers to see if they point to the same instance of an object. This is for searching a linked list for the last object in the list. Just comparing them,i.e. "do until listObject1 = listObject2", gives a error. I've also tried "listObject1.nextObject =...
Thanks for the tip! Testing A1 worked:
Public Function getRowCount() As Integer
Dim tempRows As Integer
tempRows = Worksheets("sheet1").UsedRange.Rows.Count
If tempRows = 1 And IsEmpty(Cells(1, 1)) Then
tempRows = 1
Else
If tempRows = 1 And Not (IsEmpty(Cells(1, 1))) Then
tempRows =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.