Hello everyone
My company has a excel document that keeps records. I would like to automate this process and the first step is to import .txt documents into excel.
What I would like is help with the VBA that would automatically pull the info from the .txt files and put everything in it own cell that is separated by a space. The .txt files that are being imported will all be in one folder. It is possible that info in the .txt files will be updated here and there and possibly completely new info would be added so I would like the excel sheet to repopulate the info every time it is opened.
The next part is where I'm not sure how to proceed. Whether to have each .txt file in it own sheet or all in one sheet. Below is a example of the information in the txt file
sh ip int br
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0.1999 1.1.1.1 YES NVRAM administratively down down
GigabitEthernet0/0.2002 2.2.2.22 YES NVRAM up up
GigabitEthernet0/1.1 3.3.3.3 YES NVRAM up up
GigabitEthernet0/1.2 4.4.4.4 YES NVRAM up up
GigabitEthernet0/1.10 5.5.5.5 YES NVRAM up up
GigabitEthernet0/1.11 6.6.6.6 YES NVRAM up up
GigabitEthernet0/1.200 7.7.7.7 YES manual administratively down down
GigabitEthernet0/1.210 8.8.8.8 YES NVRAM up up
Serial0/0/0 9.9.9.9 YES NVRAM down down
Tunnel500 10.10.10.10 YES manual up up
Test-RTR2821#
ex
Not all .txt files will have as many lines some only 5.
The over all Goal is to pull the name in the case above that is "Test-RTR2821#" then certain ip address along side it in a master sheet of sorts that would be used as a resource. See below.
Company name Transport Voice Data
Test-RTR2821 2.2.2.22 5.5.5.5 3.3.3.3
xxxxxx
xxxxx
xxxxx
....
What I don't know is once info has been imported would it be easier to pull the info out of one sheet or individual sheets that I need. Im also not sure how since non of the info will always be in the same cell.
side note I will have around 300 .txt documents to import
Any help with this would be greatly appreciated as I have been trying to figure this out using other VBA resources but have had no luck.
My company has a excel document that keeps records. I would like to automate this process and the first step is to import .txt documents into excel.
What I would like is help with the VBA that would automatically pull the info from the .txt files and put everything in it own cell that is separated by a space. The .txt files that are being imported will all be in one folder. It is possible that info in the .txt files will be updated here and there and possibly completely new info would be added so I would like the excel sheet to repopulate the info every time it is opened.
The next part is where I'm not sure how to proceed. Whether to have each .txt file in it own sheet or all in one sheet. Below is a example of the information in the txt file
sh ip int br
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0.1999 1.1.1.1 YES NVRAM administratively down down
GigabitEthernet0/0.2002 2.2.2.22 YES NVRAM up up
GigabitEthernet0/1.1 3.3.3.3 YES NVRAM up up
GigabitEthernet0/1.2 4.4.4.4 YES NVRAM up up
GigabitEthernet0/1.10 5.5.5.5 YES NVRAM up up
GigabitEthernet0/1.11 6.6.6.6 YES NVRAM up up
GigabitEthernet0/1.200 7.7.7.7 YES manual administratively down down
GigabitEthernet0/1.210 8.8.8.8 YES NVRAM up up
Serial0/0/0 9.9.9.9 YES NVRAM down down
Tunnel500 10.10.10.10 YES manual up up
Test-RTR2821#
ex
Not all .txt files will have as many lines some only 5.
The over all Goal is to pull the name in the case above that is "Test-RTR2821#" then certain ip address along side it in a master sheet of sorts that would be used as a resource. See below.
Company name Transport Voice Data
Test-RTR2821 2.2.2.22 5.5.5.5 3.3.3.3
xxxxxx
xxxxx
xxxxx
....
What I don't know is once info has been imported would it be easier to pull the info out of one sheet or individual sheets that I need. Im also not sure how since non of the info will always be in the same cell.
side note I will have around 300 .txt documents to import
Any help with this would be greatly appreciated as I have been trying to figure this out using other VBA resources but have had no luck.