I am trying copy data from sheet1 to sheet2 with my limited knowledge of VBA. Here is my code. Please assist.
Sub excelmac()
Sheets("Sheet1").Select
Range("A7").Select
Sheets("Sheet2").Select
Range("A10").Select
iMaxRow = 10
For iCol = 1 To 1
For iRow = 1 To iMaxRow
With Sheets("Sheet1").Cells(iRow, iCol)
If .Value = "REC#***" Then
Else
Sheets("Sheet1").Select
'xqueue = Right(ActiveCell.Offset(-2, 0).Value, Len(ActiveCell.Offset(-2, -0).Value) - 0)
xrec = Right(ActiveCell.Offset(-1, 0).Value, Len(ActiveCell.Offset(-1, 0).Value) - 0)
xchgnum = Right(ActiveCell.Offset(0, 1).Value, Len(ActiveCell.Offset(0, 1).Value) - 0)
xstartime = Right(ActiveCell.Offset(1, 1).Value, Len(ActiveCell.Offset(1, 1).Value) - 0)
xendtime = Right(ActiveCell.Offset(2, 1).Value, Len(ActiveCell.Offset(2, 1).Value) - 0)
ximpact = Right(ActiveCell.Offset(5, 6).Value, Len(ActiveCell.Offset(5, 6).Value) - 0)
xdescrpt = Right(ActiveCell.Offset(8, 1).Value, Len(ActiveCell.Offset(8, 1).Value) - 0)
Sheets("sheet2").Select
'ActiveCell.Offset(-1, 0) = xqueue
ActiveCell.Offset(0, 0) = xrec
ActiveCell.Offset(0, 1) = xchgnum
ActiveCell.Offset(0, 2).Value = xstartime
ActiveCell.Offset(0, 3).Value = xendtime
ActiveCell.Offset(0, 4).Value = ximpact
ActiveCell.Offset(0, 5).Value = xdescrpt
ActiveCell.Offset(1, 0).Select
'Sheets("Sheet1").Select
If .Value = "REC#***" Then
Else
End If
End If
End With
Next
Next
End Sub
Bookmarks