Here's my problem.
I have a spreadsheet but all of the data is on the first two rows, the column headers are repeateded when the data is repeated. What I have to do is find a column containing the word Username and then copy the cell below along with the next 12 cells on that row.
This information has to then be posted in the last blank Cell in column A.
Here's what I have so far.
Sub Process()
'
' Process - Opens file
'
Workbooks.OpenText Filename:= _
"C:\Documents and Settings\Owner.ANONYMOUS\Desktop\userlist2.txt", Origin:= _
437, StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=False _
, Space:=False, Other:=True, OtherChar:=":", FieldInfo:=Array(Array(1, 1 _
), Array(2, 1)), TrailingMinusNumbers:=True
' transposes content
Range("A1:B55").Select
Selection.Copy
Range("D1").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Columns("A:G").Select
Application.CutCopyMode = False
Selection.ClearContents
Columns("A:G").Select
Range("G1").Activate
Selection.Delete Shift:=xlToLeft
Range("A1").Select
' Finds User name column
Cells.Find(What:="UserName", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Cells.FindNext(After:=ActiveCell).Activate
ActiveCell.Offset(1).Select
' Copies data below
ActiveSheet.Range(Cells(2, 1), Cells(2, 12)).Select
Selection.Copy
If Range("a1") <> "" Then
Range("a1").End(xlUp).Offset(1, 0).Select
Else
Range("a1").End(xlUp).Select
End If
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
End Sub
If anyone has any comments or questions please don't hesitate to contact me. I would sincerely appreciate any assistance you can give.
Bookmarks