Hi All
Column BL9 TO BL25 contains names (Sometimes there might not be any names). Task is if it contains some names then to copy row(A9 TO AO9) and insert that Row xlDown and copy a name in cell B9 xlDown (the name being same as the one in column BL9 TO BL25. SO LOOP IT FOR ALL THE NAMES. copy and insert column and
copy corresponding names. Can somone pls point out the mistake in the below macro. thanks
Code
Dim i As Long
For i = 9 To Rows.count
For Each Cell In Range("BL9:BL25")
If Cell.Value <> "" Then
Range("A9:AO9").Select
Selection.Copy
Selection.End(xlDown).Select
Selection.Insert Shift:=xlDown
Range("BL8").Select
ActiveCell.Offset(1, 0).Copy
Range("B9").Select
Selection.End(xlDown).Select
ActiveCell.Offset(-1, 0).Activate
ActiveCell.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End If
Next
End Sub
Code
Column BL9 TO BL25 contains names (Sometimes there might not be any names). Task is if it contains some names then to copy row(A9 TO AO9) and insert that Row xlDown and copy a name in cell B9 xlDown (the name being same as the one in column BL9 TO BL25. SO LOOP IT FOR ALL THE NAMES. copy and insert column and
copy corresponding names. Can somone pls point out the mistake in the below macro. thanks
Code
Dim i As Long
For i = 9 To Rows.count
For Each Cell In Range("BL9:BL25")
If Cell.Value <> "" Then
Range("A9:AO9").Select
Selection.Copy
Selection.End(xlDown).Select
Selection.Insert Shift:=xlDown
Range("BL8").Select
ActiveCell.Offset(1, 0).Copy
Range("B9").Select
Selection.End(xlDown).Select
ActiveCell.Offset(-1, 0).Activate
ActiveCell.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End If
Next
End Sub
Code