gr8_big_geek
New Member
- Joined
- Feb 18, 2009
- Messages
- 41
Greetings Friends!
My am using Excel 2003~
I am once again working on a project and have hit an absolute wall! Here is what I'm trying to do:
1. Create a Userform that has one textbox and one button.
2. Have the user enter text in the textbox and press enter.
3. Once enter is pressed have the form take the data they typed into
the textbox and search a specific .txt file (beginning the search from
bottom to top to find the most recent entry) until it finds a match.
4. Take the latitude and longitude to the right of the match and convert
them to proper form. Right now my SQL provides live updates to the .txt
file only the lat/lon come accross as |-112053440|33427640|, so I need
to insert decimals in the correct places.
5. Either way, they type "c123" it will search until it matches that then
take the latitude and longitude that is to the right of the match.
6. Convert the latitude/longitude into proper format because if it pulls the
data as is it will appear as:
http://maps.google.com/maps?q=<wbr>+33480260,-11174307
which will return with an error, unless it has those decimals in there like this:
http://maps.google.com/maps?q=<wbr>+33.480260,-111.74307
If I can get the information to be imported and converted into string format I need to open a new instance of IE and have it open to this webpage.
The text in the .txt document looks like this:
[Sat Apr 10 05:53:30 2010] |AVL1|C123|-112065870|33428710|0780|0780|064000|064000|||||46412000|0|2|1000|3|20||
[Sat Apr 10 05:53:31 2010] |AVL1|C123|-112065260|33428810|0800|0800|064000|064000|||||46414000|0|2|1000|3|20||
[Sat Apr 10 05:53:52 2010] |AVL1|C123|-112059120|33428540|1000|1000|064000|064000|||||46434000|0|2|1000|3|20||
[Sat Apr 10 05:54:11 2010] |AVL1|C123|-112053440|33427640|1020|1020|054000|054000|||||46454000|0|2|1000|3|20||
Before I was manually having to type the latitude and longitude in and then generating the webpage on an AVI using:
Option Explicit
Public Sub DMS_Lookup()
On Error Resume Next
Dim mylat As String
Dim mylong As String
Dim sendstring As String
mylong = Sheet1.Cells(3, 20).Text
mylat = Sheet1.Cells(2, 20).Text
sendstring = mylat & ", " & mylong
Sheet1.WebBrowser1.Navigate ("http://maps.google.com/maps?<wbr>q=" & mylat & ", " & mylong)
Sheet1.WebBrowser1.Height = 500
Sheet1.WebBrowser1.Width = 750
End Sub
But now I have my SQL set up to update this text file. Now I just need to get the file searched and the data to go straight to the webpage instead.
Any help you could provide on the VBA coding for this would be wonderful!
Thank you in advance,
Matt~
My am using Excel 2003~
I am once again working on a project and have hit an absolute wall! Here is what I'm trying to do:
1. Create a Userform that has one textbox and one button.
2. Have the user enter text in the textbox and press enter.
3. Once enter is pressed have the form take the data they typed into
the textbox and search a specific .txt file (beginning the search from
bottom to top to find the most recent entry) until it finds a match.
4. Take the latitude and longitude to the right of the match and convert
them to proper form. Right now my SQL provides live updates to the .txt
file only the lat/lon come accross as |-112053440|33427640|, so I need
to insert decimals in the correct places.
5. Either way, they type "c123" it will search until it matches that then
take the latitude and longitude that is to the right of the match.
6. Convert the latitude/longitude into proper format because if it pulls the
data as is it will appear as:
http://maps.google.com/maps?q=<wbr>+33480260,-11174307
which will return with an error, unless it has those decimals in there like this:
http://maps.google.com/maps?q=<wbr>+33.480260,-111.74307
If I can get the information to be imported and converted into string format I need to open a new instance of IE and have it open to this webpage.
The text in the .txt document looks like this:
[Sat Apr 10 05:53:30 2010] |AVL1|C123|-112065870|33428710|0780|0780|064000|064000|||||46412000|0|2|1000|3|20||
[Sat Apr 10 05:53:31 2010] |AVL1|C123|-112065260|33428810|0800|0800|064000|064000|||||46414000|0|2|1000|3|20||
[Sat Apr 10 05:53:52 2010] |AVL1|C123|-112059120|33428540|1000|1000|064000|064000|||||46434000|0|2|1000|3|20||
[Sat Apr 10 05:54:11 2010] |AVL1|C123|-112053440|33427640|1020|1020|054000|054000|||||46454000|0|2|1000|3|20||
Before I was manually having to type the latitude and longitude in and then generating the webpage on an AVI using:
Option Explicit
Public Sub DMS_Lookup()
On Error Resume Next
Dim mylat As String
Dim mylong As String
Dim sendstring As String
mylong = Sheet1.Cells(3, 20).Text
mylat = Sheet1.Cells(2, 20).Text
sendstring = mylat & ", " & mylong
Sheet1.WebBrowser1.Navigate ("http://maps.google.com/maps?<wbr>q=" & mylat & ", " & mylong)
Sheet1.WebBrowser1.Height = 500
Sheet1.WebBrowser1.Width = 750
End Sub
But now I have my SQL set up to update this text file. Now I just need to get the file searched and the data to go straight to the webpage instead.
Any help you could provide on the VBA coding for this would be wonderful!
Thank you in advance,
Matt~