Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
I am completely new to excel programming and I would like some help if possible. I have a spreadsheet with some logging information. I am trying to get the text split when I found the string "Initializing server", which can happens many times. So basically, I need to create new sheets every time I found this string, copying all the content found until it reaches the row with that string to the new sheet. Here is a piece of the log file: | 2008-06-16 13:34:22.916 | 71212 | ArsInit | 101 | Initializing server | 3 | 2008-06-16 13:34:22.948 | 71212 | ReqLoop | 201 | Entering Request 1 | 1 | 2008-06-16 13:34:22.948 | 71212 | ReqLoop | 227 | Received Scriptname: /scripts/adess.dll | 1 | 2008-06-16 13:34:22.948 | 71212 | ReqLoop | 213 | Reading GET request | 1 | 2008-06-16 13:35:01.462 | 71212 | ArsInit | 101 | Initializing server | 3 | 2008-06-16 13:35:01.477 | 71212 | ReqLoop | 231 | Creating request | 1 | 2008-06-16 13:35:01.477 | 71212 | ReqLoop | 219 | Created request | 1 | 2008-06-16 13:35:01.477 | 71212 | ReqLoop | 235 | Request: service = GetPollingDelay | 1 | 2008-06-16 13:35:01.477 | 71212 | ReqLoop | 235 | Request: connectionKey = | 1 On this case, the result should be two sheets, one with this info | 2008-06-16 13:34:22.948 | 71212 | ReqLoop | 201 | Entering Request 1 | 1 | 2008-06-16 13:34:22.948 | 71212 | ReqLoop | 227 | Received Scriptname: /scripts/adess.dll | 1 | 2008-06-16 13:34:22.948 | 71212 | ReqLoop | 213 | Reading GET request | 1 and another one with this | 2008-06-16 13:35:01.477 | 71212 | ReqLoop | 231 | Creating request | 1 | 2008-06-16 13:35:01.477 | 71212 | ReqLoop | 219 | Created request | 1 | 2008-06-16 13:35:01.477 | 71212 | ReqLoop | 235 | Request: service = GetPollingDelay | 1 | 2008-06-16 13:35:01.477 | 71212 | ReqLoop | 235 | Request: connectionKey = | 1 Is is possible to help me? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not sure why my previous answer didn't get posted
Sub splitSheet() InitStr = UCase("Initializing server") With Sheets("Sheet1") RowCount = 1 FirstRow = RowCount Do While .Range("A" & RowCount) < "" StrPos = InStr(UCase(.Range("A" & RowCount)), InitStr) If .Range("A" & (RowCount + 1)) = "" Or StrPos 0 Then If StrPos 0 Then LastRow = RowCount - 1 Else LastRow = RowCount End If If LastRow < 0 Then Set newsht = Worksheets.Add(after:=Sheets(Sheets.Count)) .Rows(FirstRow & ":" & LastRow).Copy _ Destination:=newsht.Rows(1) End If FirstRow = RowCount + 1 End If RowCount = RowCount + 1 Loop End With End Sub "Subenemi" wrote: Hello I am completely new to excel programming and I would like some help if possible. I have a spreadsheet with some logging information. I am trying to get the text split when I found the string "Initializing server", which can happens many times. So basically, I need to create new sheets every time I found this string, copying all the content found until it reaches the row with that string to the new sheet. Here is a piece of the log file: | 2008-06-16 13:34:22.916 | 71212 | ArsInit | 101 | Initializing server | 3 | 2008-06-16 13:34:22.948 | 71212 | ReqLoop | 201 | Entering Request 1 | 1 | 2008-06-16 13:34:22.948 | 71212 | ReqLoop | 227 | Received Scriptname: /scripts/adess.dll | 1 | 2008-06-16 13:34:22.948 | 71212 | ReqLoop | 213 | Reading GET request | 1 | 2008-06-16 13:35:01.462 | 71212 | ArsInit | 101 | Initializing server | 3 | 2008-06-16 13:35:01.477 | 71212 | ReqLoop | 231 | Creating request | 1 | 2008-06-16 13:35:01.477 | 71212 | ReqLoop | 219 | Created request | 1 | 2008-06-16 13:35:01.477 | 71212 | ReqLoop | 235 | Request: service = GetPollingDelay | 1 | 2008-06-16 13:35:01.477 | 71212 | ReqLoop | 235 | Request: connectionKey = | 1 On this case, the result should be two sheets, one with this info | 2008-06-16 13:34:22.948 | 71212 | ReqLoop | 201 | Entering Request 1 | 1 | 2008-06-16 13:34:22.948 | 71212 | ReqLoop | 227 | Received Scriptname: /scripts/adess.dll | 1 | 2008-06-16 13:34:22.948 | 71212 | ReqLoop | 213 | Reading GET request | 1 and another one with this | 2008-06-16 13:35:01.477 | 71212 | ReqLoop | 231 | Creating request | 1 | 2008-06-16 13:35:01.477 | 71212 | ReqLoop | 219 | Created request | 1 | 2008-06-16 13:35:01.477 | 71212 | ReqLoop | 235 | Request: service = GetPollingDelay | 1 | 2008-06-16 13:35:01.477 | 71212 | ReqLoop | 235 | Request: connectionKey = | 1 Is is possible to help me? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Select, find in another book, copy, return and paste | Excel Discussion (Misc queries) | |||
PASTE LINK option not available when I select PASTE SPECIAL to link an image in Excel to a Word document. | Links and Linking in Excel | |||
Find/Copy/paste.. then Find/Paste - not working ... at all.... | Excel Programming | |||
help with find value select range and paste to diff sheet, multipl | Excel Programming | |||
I need to find a macro to find data cut and paste to another colu. | Excel Programming |