I am trying to copy and paste cells from my first worksheet "Inputs" to a second sheet "Sheet1". I am doing this for rows 1-120. I have been able to do this easily for a range of cells, but now I need to narrow that down to cutting and pasting specific cells to other cells. For example I need to copy b21, h21, and z21 from "Inputs" to a5, d5, and h5 on "Sheet1". Any advice on how I could macro write this portion?
Sub macro1()
Application.ScreenUpdating = False
Dim i As Long
Dim sheet1count As Integer
i = 21
sheet1count = 0
Do While i <= 120
Worksheets("Input").Activate
Range("B" & i).Select
If Range("B" & i) = "MPLS IP Service - IPVPN" Then
Range(("B" & i), ("z" & i)).Select
Application.CutCopyMode = False
Selection.Copy
Worksheets("Sheet1").Activate
Range("A" & (3 + sheet1count)).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
sheet1count = sheet1count + 1
End If
SkipLine:
i = i + 1
Loop
Application.ScreenUpdating = True
Worksheets("Sheet1").Activate
End Sub
Sub macro1()
Application.ScreenUpdating = False
Dim i As Long
Dim sheet1count As Integer
i = 21
sheet1count = 0
Do While i <= 120
Worksheets("Input").Activate
Range("B" & i).Select
If Range("B" & i) = "MPLS IP Service - IPVPN" Then
Range(("B" & i), ("z" & i)).Select
Application.CutCopyMode = False
Selection.Copy
Worksheets("Sheet1").Activate
Range("A" & (3 + sheet1count)).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
sheet1count = sheet1count + 1
End If
SkipLine:
i = i + 1
Loop
Application.ScreenUpdating = True
Worksheets("Sheet1").Activate
End Sub