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 =...
Can anyone figure out why, in sub test(), iRow is always equal to 1 when a blank sheet is being used? (Cells(iRow,1).value = i always puts the data in A1. My intention is that as data is added to a row, getRowCount() should return an incremented number to show a new item has been added. Each...
OK, the problem seems to have something to do with the string itself, or maybe the characters in the string. I'm thinking now that all the carriage returns, line feeds, and quotation marks that are included as part of the HTML document are doing something devious. I'm now wondering if this is...
Thank you for the suggestions.
This is a personal project I'm working on and I am at work now, so I'll try out a known string (I'll copy/paste from "view source") tomorrow. Maybe that will provide a clue as to what's going on.
As far as the HTML not appearing logically, I am copy/pasting the...
I'm using the VBA function InStr to search a LONG string for specific values. The function doesn't seem to work properly - it doesn't find the correct value when it is present and also returns an incorrect position.
The string that I'm searching is the source code of an HTML document. I put...
Maybe you could use excel to produce the final report with the flipped value. Cell contents can be rotated from -90 to +90 degrees. That would mean doing something like rotating everything +90 and the field you want flipped would be rotated -90. It wouldn't be much use on screen, but could be...
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.