Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Slicing and Dicing 1 Cell

So I want to take information that I get via a web query in Excel and
break it up.
The data currently looks like this:
InternalIP:Port ExternalIP:80 OUT masqueraded to FirewalIP:29176
timeout 6555
I would like to have each column give me this data:
InternalIP
InternalIP Port
External IP
In/Out
FirewallIP Port

The first part is easy, I can just do left(13) or so. But I would
rather do this programmatically so that it automatically updates
spreadsheet B with the new data after spreadsheet A does an import.
Ideally, I would like it to run a DNS lookup as well.

Any thoughts? If it's easier, I might just write a program to do it.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Slicing and Dicing 1 Cell

Hi
This will parse out the four text strings ether side of the colons:
Dim TextStrings(1 to 4) as String
Temp = QueryString 'your query output
For i = 1 to 3
TextStrings(i) = Left(Temp, Instr(Temp, ":")-1)
Temp = Right(Temp,Len(Temp)-Instr(Temp, ":"))
next i
TextStrings(4) = Temp

You could do the same thing with each TextStrings(i) based on the " "
rather than the ":". Now extract the bits you want.
regards
Paul

Justin wrote:

So I want to take information that I get via a web query in Excel and
break it up.
The data currently looks like this:
InternalIP:Port ExternalIP:80 OUT masqueraded to FirewalIP:29176
timeout 6555
I would like to have each column give me this data:
InternalIP
InternalIP Port
External IP
In/Out
FirewallIP Port

The first part is easy, I can just do left(13) or so. But I would
rather do this programmatically so that it automatically updates
spreadsheet B with the new data after spreadsheet A does an import.
Ideally, I would like it to run a DNS lookup as well.

Any thoughts? If it's easier, I might just write a program to do it.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Slicing and Dicing 1 Cell

Justin,
How far does TextToColumns get you ?
Or look into Regular Expressions.
http://visualbasic.about.com/od/usin...l/blregexa.htm

You want to resolve a host name from an IP address ?
http://vbnet.mvps.org/code/network/hostnamefromip.htm

NickHK

"Justin" wrote in message
ups.com...
So I want to take information that I get via a web query in Excel and
break it up.
The data currently looks like this:
InternalIP:Port ExternalIP:80 OUT masqueraded to FirewalIP:29176
timeout 6555
I would like to have each column give me this data:
InternalIP
InternalIP Port
External IP
In/Out
FirewallIP Port

The first part is easy, I can just do left(13) or so. But I would
rather do this programmatically so that it automatically updates
spreadsheet B with the new data after spreadsheet A does an import.
Ideally, I would like it to run a DNS lookup as well.

Any thoughts? If it's easier, I might just write a program to do it.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Slicing and Dicing 1 Cell

TextToColumns gets me a #VALUE error.
The code is:

Public Function Text2Columns(ByVal input2use As Range)
Dim output As Range
output = Range("NATDump!B1")
input2use.TextToColumns output, , , , , , , True
End Function

NickHK wrote:
Justin,
How far does TextToColumns get you ?
Or look into Regular Expressions.
http://visualbasic.about.com/od/usin...l/blregexa.htm

You want to resolve a host name from an IP address ?
http://vbnet.mvps.org/code/network/hostnamefromip.htm

NickHK

"Justin" wrote in message
ups.com...
So I want to take information that I get via a web query in Excel and
break it up.
The data currently looks like this:
InternalIP:Port ExternalIP:80 OUT masqueraded to FirewalIP:29176
timeout 6555
I would like to have each column give me this data:
InternalIP
InternalIP Port
External IP
In/Out
FirewallIP Port

The first part is easy, I can just do left(13) or so. But I would
rather do this programmatically so that it automatically updates
spreadsheet B with the new data after spreadsheet A does an import.
Ideally, I would like it to run a DNS lookup as well.

Any thoughts? If it's easier, I might just write a program to do it.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Slicing and Dicing 1 Cell

Justin,
Not sure how you are using that code, but recoding a macro will give you the
arguments.

NickHK
P.S. Your function does not return a value, which is all worksheet functions
can do.

"Justin" wrote in message
ups.com...
TextToColumns gets me a #VALUE error.
The code is:

Public Function Text2Columns(ByVal input2use As Range)
Dim output As Range
output = Range("NATDump!B1")
input2use.TextToColumns output, , , , , , , True
End Function

NickHK wrote:
Justin,
How far does TextToColumns get you ?
Or look into Regular Expressions.
http://visualbasic.about.com/od/usin...l/blregexa.htm

You want to resolve a host name from an IP address ?
http://vbnet.mvps.org/code/network/hostnamefromip.htm

NickHK

"Justin" wrote in message
ups.com...
So I want to take information that I get via a web query in Excel and
break it up.
The data currently looks like this:
InternalIP:Port ExternalIP:80 OUT masqueraded to FirewalIP:29176
timeout 6555
I would like to have each column give me this data:
InternalIP
InternalIP Port
External IP
In/Out
FirewallIP Port

The first part is easy, I can just do left(13) or so. But I would
rather do this programmatically so that it automatically updates
spreadsheet B with the new data after spreadsheet A does an import.
Ideally, I would like it to run a DNS lookup as well.

Any thoughts? If it's easier, I might just write a program to do it.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options Yuvraj Excel Discussion (Misc queries) 0 June 29th 09 11:20 AM
Slicing Data (Alternative to SUMIFS) Marcelo[_2_] Excel Worksheet Functions 2 April 17th 09 12:59 AM
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 [email protected] Excel Worksheet Functions 1 August 22nd 08 02:04 AM
Slicing Pie Charts trunzop Excel Discussion (Misc queries) 1 May 23rd 07 10:32 PM
How to create/run "cell A equals Cell B put Cell C info in Cell D abmb161 Excel Discussion (Misc queries) 5 January 26th 06 06:36 PM


All times are GMT +1. The time now is 11:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"