I have two Macros
1) Adds a column with Updated field to correct date format from the below text format
<TABLE style="WIDTH: 259pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=345><COLGROUP><COL style="WIDTH: 259pt; mso-width-source: userset; mso-width-alt: 12617" width=345><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 259pt; HEIGHT: 12.75pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl63 height=17 width=345>Found_In_Release_Date</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 259pt; HEIGHT: 12.75pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl63 height=17 width=345>February 22, 2011 1:59:21 PM GMT-05:00</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 259pt; HEIGHT: 12.75pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl63 height=17 width=345>June 25, 2011 3:22:05 PM GMT-05:00</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 259pt; HEIGHT: 12.75pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl63 height=17 width=345>June 25, 2011 12:26:14 PM GMT-05:00</TD></TR></TBODY></TABLE>
Sub FixDate()
Dim a As Long, x As Long
x = Cells(Rows.Count, 15).End(xlUp).row
For a = 2 To x + 1
Cells(a, 16) = Left((Left(Cells(a, 15), 3) & " " & Right(Cells(a, 15), 26)), 9)
Cells(a, 16).NumberFormat = "yyyy - mm"
Next a
MsgBox "Corrected CQ date field is added"
End Sub
2) Adds the select columns and rows into sheet2 from sheet1.
Sub Transfer()
Dim row As Long
With ThisWorkbook.Worksheets("Sheet1")
row = Book1.Range("A" & Rows.Count).End(xlUp).row
If Not row > 1 Then Exit Sub
Book1.Range("A2:A" & row, "A2:P2").SpecialCells(xlCellTypeVisible).Copy _
ThisWorkbook.Worksheets("Sheet2").Cells(2, 1)
'End With
MsgBox "Defects table has been updated"
End Sub
What I want is for the datato be moved from Workbook1,sheet1 to Workbook2,Sheet1 Rather than two sheets between the same work book.
Aslo is is possible to combine 1) and 2), such that A single macro can add that extra column as in macro 1) and also move data into another sheet form another workbook like in macro 2)?
Help much appreciated thank you
1) Adds a column with Updated field to correct date format from the below text format
<TABLE style="WIDTH: 259pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=345><COLGROUP><COL style="WIDTH: 259pt; mso-width-source: userset; mso-width-alt: 12617" width=345><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 259pt; HEIGHT: 12.75pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl63 height=17 width=345>Found_In_Release_Date</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 259pt; HEIGHT: 12.75pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl63 height=17 width=345>February 22, 2011 1:59:21 PM GMT-05:00</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 259pt; HEIGHT: 12.75pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl63 height=17 width=345>June 25, 2011 3:22:05 PM GMT-05:00</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 259pt; HEIGHT: 12.75pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl63 height=17 width=345>June 25, 2011 12:26:14 PM GMT-05:00</TD></TR></TBODY></TABLE>
Sub FixDate()
Dim a As Long, x As Long
x = Cells(Rows.Count, 15).End(xlUp).row
For a = 2 To x + 1
Cells(a, 16) = Left((Left(Cells(a, 15), 3) & " " & Right(Cells(a, 15), 26)), 9)
Cells(a, 16).NumberFormat = "yyyy - mm"
Next a
MsgBox "Corrected CQ date field is added"
End Sub
2) Adds the select columns and rows into sheet2 from sheet1.
Sub Transfer()
Dim row As Long
With ThisWorkbook.Worksheets("Sheet1")
row = Book1.Range("A" & Rows.Count).End(xlUp).row
If Not row > 1 Then Exit Sub
Book1.Range("A2:A" & row, "A2:P2").SpecialCells(xlCellTypeVisible).Copy _
ThisWorkbook.Worksheets("Sheet2").Cells(2, 1)
'End With
MsgBox "Defects table has been updated"
End Sub
What I want is for the datato be moved from Workbook1,sheet1 to Workbook2,Sheet1 Rather than two sheets between the same work book.
Aslo is is possible to combine 1) and 2), such that A single macro can add that extra column as in macro 1) and also move data into another sheet form another workbook like in macro 2)?
Help much appreciated thank you