Pulling Data and formatting
Closed
scorro1
Posts
2
Registration date
Thursday March 26, 2009
Status
Member
Last seen
March 27, 2009
-
Mar 27, 2009 at 12:30 PM
scorro1 Posts 2 Registration date Thursday March 26, 2009 Status Member Last seen March 27, 2009 - Mar 27, 2009 at 03:38 PM
scorro1 Posts 2 Registration date Thursday March 26, 2009 Status Member Last seen March 27, 2009 - Mar 27, 2009 at 03:38 PM
Related:
- Pulling Data and formatting
- Tmobile data check - Guide
- Gta 5 data download for pc - Download - Action and adventure
- Digital data transmission - Guide
- Data transmission cable - Guide
- Transfer data from one excel worksheet to another automatically - Guide
1 response
scorro1
Posts
2
Registration date
Thursday March 26, 2009
Status
Member
Last seen
March 27, 2009
Mar 27, 2009 at 03:38 PM
Mar 27, 2009 at 03:38 PM
A little more towards fininshing. But now it wont copy all the rows even if they are there once it finds a blank...
Sub Remove_Strike_Thru()
'
' Remove_Strike_Thru Macro
' Macro recorded 3/27/2009 by 10053068
'
' Keyboard Shortcut: Ctrl+t
'
'Removes Strike Thrus
Sheets("Sheet1").Select
Range("D1:D1000").Select
Dim X As Long
Dim C As Range
For Each C In Selection
For X = Len(C.Value) To 1 Step -1
If C.Characters(X, 1).Font.Strikethrough Then
C.Characters(X, 1).Delete
End If
Next
C.Value = Application.WorksheetFunction.Trim(C.Value)
Next
'Remove all formatting except changes in font and font size
'Turn off screen updates to improve performance
Application.ScreenUpdating = False
With Selection
'Remove cell colors
.Interior.ColorIndex = xlNone
'Remove all cell borders
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
'Remove all special font properties and formatting
With .Font
.FontStyle = "Regular"
.Strikethrough = False
.Superscript = False
.Subscript = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
End With
'Restore screen updates to display changes
Application.ScreenUpdating = True
'Autofit all cells
Cells.Select
Cells.EntireColumn.AutoFit
Dim DestSheet As Worksheet
Set DestSheet = Worksheets("Sheet2")
Dim sRow As Long 'row index on source worksheet
Dim dRow As Long 'row index on destination worksheet
Dim sCount As Long
sCount = 0
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Application Name" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
'B = B - 1
'Cells(sRow, "A").Copy Destination:=Sheet5.Cells(dRow, "B")
'B = B + 1
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "B")
'Cells(sRow, "C").Copy Destination:=Sheet5.Cells(dRow, "C")
'Cells(sRow, "D").Copy Destination:=Sheet5.Cells(dRow, "D")
End If
Next sRow
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Priority" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
'Cells(sRow, "A").Copy Destination:=Sheet5.Cells(dRow, "C1")
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "C")
'Cells(sRow, "C").Copy Destination:=Sheet5.Cells(dRow, "C")
'Cells(sRow, "D").Copy Destination:=Sheet5.Cells(dRow, "D")
End If
Next sRow
'Takes Ticket Method
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Ticket Method" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
'Cells(sRow, "A").Copy Destination:=Sheet5.Cells(dRow, "D1")
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "D")
End If
Next sRow
'Takes Date Reported
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Date Reported" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "E")
End If
Next sRow
'Takes Type
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Type" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "F")
End If
Next sRow
'Takes Requestor Name
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Requestor Name" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "G")
End If
Next sRow
'Takes Location Name
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Location Name" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "H")
End If
Next sRow
'Takes Location Code
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Location Code" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "I")
End If
Next sRow
'Takes Issue Description
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Issue Description" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "J")
End If
Next sRow
'Takes Resolution Notes
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Resolution Notes" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "K")
End If
Next sRow
MsgBox sCount & " Significant rows copied", vbInformation, "Transfer Done"
Sheets("Sheet2").Select
End Sub
Sub Remove_Strike_Thru()
'
' Remove_Strike_Thru Macro
' Macro recorded 3/27/2009 by 10053068
'
' Keyboard Shortcut: Ctrl+t
'
'Removes Strike Thrus
Sheets("Sheet1").Select
Range("D1:D1000").Select
Dim X As Long
Dim C As Range
For Each C In Selection
For X = Len(C.Value) To 1 Step -1
If C.Characters(X, 1).Font.Strikethrough Then
C.Characters(X, 1).Delete
End If
Next
C.Value = Application.WorksheetFunction.Trim(C.Value)
Next
'Remove all formatting except changes in font and font size
'Turn off screen updates to improve performance
Application.ScreenUpdating = False
With Selection
'Remove cell colors
.Interior.ColorIndex = xlNone
'Remove all cell borders
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
'Remove all special font properties and formatting
With .Font
.FontStyle = "Regular"
.Strikethrough = False
.Superscript = False
.Subscript = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
End With
'Restore screen updates to display changes
Application.ScreenUpdating = True
'Autofit all cells
Cells.Select
Cells.EntireColumn.AutoFit
Dim DestSheet As Worksheet
Set DestSheet = Worksheets("Sheet2")
Dim sRow As Long 'row index on source worksheet
Dim dRow As Long 'row index on destination worksheet
Dim sCount As Long
sCount = 0
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Application Name" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
'B = B - 1
'Cells(sRow, "A").Copy Destination:=Sheet5.Cells(dRow, "B")
'B = B + 1
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "B")
'Cells(sRow, "C").Copy Destination:=Sheet5.Cells(dRow, "C")
'Cells(sRow, "D").Copy Destination:=Sheet5.Cells(dRow, "D")
End If
Next sRow
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Priority" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
'Cells(sRow, "A").Copy Destination:=Sheet5.Cells(dRow, "C1")
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "C")
'Cells(sRow, "C").Copy Destination:=Sheet5.Cells(dRow, "C")
'Cells(sRow, "D").Copy Destination:=Sheet5.Cells(dRow, "D")
End If
Next sRow
'Takes Ticket Method
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Ticket Method" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
'Cells(sRow, "A").Copy Destination:=Sheet5.Cells(dRow, "D1")
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "D")
End If
Next sRow
'Takes Date Reported
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Date Reported" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "E")
End If
Next sRow
'Takes Type
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Type" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "F")
End If
Next sRow
'Takes Requestor Name
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Requestor Name" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "G")
End If
Next sRow
'Takes Location Name
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Location Name" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "H")
End If
Next sRow
'Takes Location Code
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Location Code" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "I")
End If
Next sRow
'Takes Issue Description
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Issue Description" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "J")
End If
Next sRow
'Takes Resolution Notes
dRow = 1
For sRow = 1 To Range("A65536").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "A") Like "Resolution Notes" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "K")
End If
Next sRow
MsgBox sCount & " Significant rows copied", vbInformation, "Transfer Done"
Sheets("Sheet2").Select
End Sub